import AddPurchaseForm from '@/components/Transactions/AddPurchaseForm';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';

interface PurchaseModalProps {
    isOpen: boolean;
    onClose: () => void;
    onSuccess?: () => void;
}

export default function PurchaseModal({ isOpen, onClose, onSuccess }: PurchaseModalProps) {
    const handleSuccess = () => {
        if (onSuccess) {
            onSuccess();
        }
        onClose();
    };

    return (
        <Dialog open={isOpen} onOpenChange={onClose}>
            <DialogContent className="bg-black border-red-500/30 text-red-400 max-w-md">
                <DialogHeader>
                    <DialogTitle className="text-red-500 font-mono tracking-wide">
                        ADD PURCHASE
                    </DialogTitle>
                </DialogHeader>
                
                <div className="mt-4">
                    <AddPurchaseForm onSuccess={handleSuccess} />
                </div>
            </DialogContent>
        </Dialog>
    );
}