import { type ReactNode, useState } from "react"; import { Checkbox } from "../ui/checkbox"; import { Label } from "../ui/label"; import { ConfirmAlert } from "./confirm-alert"; export function ConfirmDeleteAlert({ children, title = "Confirm Delete", data, onConfirm, }: { children: ReactNode; title?: string; data: IProduct; onConfirm: (unlist: boolean) => void | Promise; }) { const [unlist, setUnlist] = useState(false); return (

This action will permanently delete the item. You can also choose to unlist it before deleting.

{data.status && (
setUnlist(!!checked)} />
)} } onConfirm={() => onConfirm(unlist)} > {children}
); }