2024-09-18 21:18:16 +03:00
|
|
|
import {
|
|
|
|
|
AlertDialog,
|
|
|
|
|
AlertDialogAction,
|
|
|
|
|
AlertDialogCancel,
|
|
|
|
|
AlertDialogContent,
|
|
|
|
|
AlertDialogDescription,
|
|
|
|
|
AlertDialogFooter,
|
|
|
|
|
AlertDialogHeader,
|
|
|
|
|
AlertDialogTitle,
|
|
|
|
|
} from "@/components/ui/alert-dialog";
|
2024-10-17 14:30:52 +03:00
|
|
|
import { buttonVariants } from "../ui/button";
|
2024-09-18 21:18:16 +03:00
|
|
|
|
|
|
|
|
type DeleteSearchDialogProps = {
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
onConfirm: () => void;
|
|
|
|
|
searchName: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function DeleteSearchDialog({
|
|
|
|
|
isOpen,
|
|
|
|
|
onClose,
|
|
|
|
|
onConfirm,
|
|
|
|
|
searchName,
|
|
|
|
|
}: DeleteSearchDialogProps) {
|
|
|
|
|
return (
|
|
|
|
|
<AlertDialog open={isOpen} onOpenChange={onClose}>
|
|
|
|
|
<AlertDialogContent>
|
|
|
|
|
<AlertDialogHeader>
|
|
|
|
|
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
|
|
|
<AlertDialogDescription>
|
|
|
|
|
This will permanently delete the saved search "{searchName}".
|
|
|
|
|
</AlertDialogDescription>
|
|
|
|
|
</AlertDialogHeader>
|
|
|
|
|
<AlertDialogFooter>
|
|
|
|
|
<AlertDialogCancel onClick={onClose}>Cancel</AlertDialogCancel>
|
|
|
|
|
<AlertDialogAction
|
|
|
|
|
onClick={onConfirm}
|
2024-10-17 14:30:52 +03:00
|
|
|
className={buttonVariants({ variant: "destructive" })}
|
2024-09-18 21:18:16 +03:00
|
|
|
>
|
|
|
|
|
Delete
|
|
|
|
|
</AlertDialogAction>
|
|
|
|
|
</AlertDialogFooter>
|
|
|
|
|
</AlertDialogContent>
|
|
|
|
|
</AlertDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|