From 21d8148fc5b1234cd4523e66ccaa8971ad104560 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 14 May 2025 05:44:16 +0000 Subject: (최겸)기술영업 조선 rfq 테스트 삭제 -> 구매 조선 rfq(검토용견적)으로 개발 예정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfqs-ship/table/delete-rfqs-dialog.tsx | 149 ----------------------------- 1 file changed, 149 deletions(-) delete mode 100644 lib/rfqs-ship/table/delete-rfqs-dialog.tsx (limited to 'lib/rfqs-ship/table/delete-rfqs-dialog.tsx') diff --git a/lib/rfqs-ship/table/delete-rfqs-dialog.tsx b/lib/rfqs-ship/table/delete-rfqs-dialog.tsx deleted file mode 100644 index 09596bc7..00000000 --- a/lib/rfqs-ship/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 { Rfq, 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