import { useState, type ReactNode } from "react"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "~/components/ui/alert-dialog"; import Loader from "../loader"; import { delay } from "~/features/delay"; import { Button } from "../ui/button"; export function ConfirmAlert({ children, title = "Bạn có chắc không?", description = "Hành động này không thể hoàn tác.", onConfirm, }: { children: ReactNode; title?: string; description?: string; onConfirm: () => void | Promise; }) { const [loading, setLoading] = useState(false); const [open, setOpen] = useState(false); return ( {children} {title} {description} Hủy ); }