import React from 'react';
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "@/Components/ui/dialog";
import { Button } from "@/Components/ui/button";
import { useTranslation } from '@/hooks/useTranslation';

export default function ConfirmModal({ 
    open, 
    onOpenChange, 
    onConfirm, 
    title, 
    description, 
    confirmText = "Confirm", 
    variant = "default" 
}) {
    const { t } = useTranslation();

    return (
        <Dialog open={open} onOpenChange={onOpenChange}>
            <DialogContent>
                <DialogHeader>
                    <DialogTitle>{t(title)}</DialogTitle>
                    <DialogDescription>{t(description)}</DialogDescription>
                </DialogHeader>
                <DialogFooter className="mt-4">
                    <Button variant="outline" onClick={() => onOpenChange(false)}>
                        {t('Cancel')}
                    </Button>
                    <Button variant={variant} onClick={onConfirm}>
                        {t(confirmText)}
                    </Button>
                </DialogFooter>
            </DialogContent>
        </Dialog>
    );
}