import { toast } from "@/hooks/useToast"; import { ConfirmDialog } from "@/components/confirm-dialog"; import { useTasks } from "../context/tasks-context"; import { TasksImportDialog } from "./tasks-import-dialog"; import { TasksMutateDrawer } from "./tasks-mutate-drawer"; export function TasksDialogs() { const { open, setOpen, currentRow, setCurrentRow } = useTasks(); return ( <> setOpen("create")} /> setOpen("import")} /> {currentRow && ( <> { setOpen("update"); setTimeout(() => { setCurrentRow(null); }, 500); }} currentRow={currentRow} /> { setOpen("delete"); setTimeout(() => { setCurrentRow(null); }, 500); }} handleConfirm={() => { setOpen(null); setTimeout(() => { setCurrentRow(null); }, 500); toast({ title: "The following task has been deleted:", description: (
										
											{JSON.stringify(currentRow, null, 2)}
										
									
), }); }} className="max-w-md" title={`Delete this task: ${currentRow.id} ?`} desc={ <> You are about to delete a task with the ID{" "} {currentRow.id}.
This action cannot be undone. } confirmText="Delete" /> )} ); }