budget-view-finance/src/components/dashboard/table/TransactionDeleteDialog.tsx
gpt-engineer-app[bot] c2c12ae5b3 Refactor: Split TransactionsTable into components
Refactors the TransactionsTable component into smaller, more manageable components for improved code organization and readability.
2025-06-24 18:44:40 +00:00

34 lines
1.2 KiB
TypeScript

import { Transaction } from '@/types/financialTypes';
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog';
interface TransactionDeleteDialogProps {
isOpen: boolean;
transaction: Transaction | null;
onClose: () => void;
onConfirm: () => void;
}
const TransactionDeleteDialog = ({ isOpen, transaction, onClose, onConfirm }: TransactionDeleteDialogProps) => {
return (
<AlertDialog open={isOpen} onOpenChange={onClose}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Confirmar exclusão</AlertDialogTitle>
<AlertDialogDescription>
Tem certeza que deseja excluir esta transação? Esta ação não pode ser desfeita.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancelar</AlertDialogCancel>
<AlertDialogAction onClick={onConfirm} className="bg-red-600 hover:bg-red-700">
Excluir
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
};
export default TransactionDeleteDialog;