From 44794a8628997c0d979adb5bd6711cd848b3e397 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 9 Jul 2025 06:27:10 +0000 Subject: (최겸) 기술영업 판교 미팅 이전 rfq-tech 삭제 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfqs-tech/table/delete-rfqs-dialog.tsx | 149 ----------------------------- 1 file changed, 149 deletions(-) delete mode 100644 lib/rfqs-tech/table/delete-rfqs-dialog.tsx (limited to 'lib/rfqs-tech/table/delete-rfqs-dialog.tsx') diff --git a/lib/rfqs-tech/table/delete-rfqs-dialog.tsx b/lib/rfqs-tech/table/delete-rfqs-dialog.tsx deleted file mode 100644 index 729bc526..00000000 --- a/lib/rfqs-tech/table/delete-rfqs-dialog.tsx +++ /dev/null @@ -1,149 +0,0 @@ -"use client" - -import * as React from "react" -import { type Row } from "@tanstack/react-table" -import { Loader, Trash } from "lucide-react" -import { toast } from "sonner" - -import { useMediaQuery } from "@/hooks/use-media-query" -import { Button } from "@/components/ui/button" -import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog" -import { - Drawer, - DrawerClose, - DrawerContent, - DrawerDescription, - DrawerFooter, - DrawerHeader, - DrawerTitle, - DrawerTrigger, -} from "@/components/ui/drawer" - -import { RfqWithItemCount } from "@/db/schema/rfq" -import { removeRfqs } from "../service" - -interface DeleteRfqsDialogProps - extends React.ComponentPropsWithoutRef { - rfqs: Row["original"][] - showTrigger?: boolean - onSuccess?: () => void -} - -export function DeleteRfqsDialog({ - rfqs, - showTrigger = true, - onSuccess, - ...props -}: DeleteRfqsDialogProps) { - const [isDeletePending, startDeleteTransition] = React.useTransition() - const isDesktop = useMediaQuery("(min-width: 640px)") - - function onDelete() { - startDeleteTransition(async () => { - const { error } = await removeRfqs({ - ids: rfqs.map((rfq) => rfq.rfqId), - }) - - if (error) { - toast.error(error) - return - } - - props.onOpenChange?.(false) - toast.success("Tasks deleted") - onSuccess?.() - }) - } - - if (isDesktop) { - return ( - - {showTrigger ? ( - - - - ) : null} - - - Are you absolutely sure? - - This action cannot be undone. This will permanently delete your{" "} - {rfqs.length} - {rfqs.length === 1 ? " task" : " rfqs"} from our servers. - - - - - - - - - - - ) - } - - return ( - - {showTrigger ? ( - - - - ) : null} - - - Are you absolutely sure? - - This action cannot be undone. This will permanently delete your{" "} - {rfqs.length} - {rfqs.length === 1 ? " task" : " rfqs"} from our servers. - - - - - - - - - - - ) -} -- cgit v1.2.3