From 44b74ff4170090673b6eeacd8c528e0abf47b7aa Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 1 Dec 2025 19:52:06 +0900 Subject: (김준회) deprecated code 정리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/b-rfq/attachment/delete-attachment-dialog.tsx | 182 ---------------------- 1 file changed, 182 deletions(-) delete mode 100644 lib/b-rfq/attachment/delete-attachment-dialog.tsx (limited to 'lib/b-rfq/attachment/delete-attachment-dialog.tsx') diff --git a/lib/b-rfq/attachment/delete-attachment-dialog.tsx b/lib/b-rfq/attachment/delete-attachment-dialog.tsx deleted file mode 100644 index b5471520..00000000 --- a/lib/b-rfq/attachment/delete-attachment-dialog.tsx +++ /dev/null @@ -1,182 +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 { deleteRfqAttachments } from "../service" - - -// 첨부파일 타입 (실제 타입에 맞게 조정 필요) -type RfqAttachment = { - id: number - serialNo: string - originalFileName: string - attachmentType: string - currentRevision: string -} - -interface DeleteAttachmentsDialogProps - extends React.ComponentPropsWithoutRef { - attachments: Row["original"][] - showTrigger?: boolean - onSuccess?: () => void -} - -export function DeleteAttachmentsDialog({ - attachments, - showTrigger = true, - onSuccess, - ...props -}: DeleteAttachmentsDialogProps) { - const [isDeletePending, startDeleteTransition] = React.useTransition() - const isDesktop = useMediaQuery("(min-width: 640px)") - - function onDelete() { - startDeleteTransition(async () => { - const result = await deleteRfqAttachments({ - ids: attachments.map((attachment) => attachment.id), - }) - - if (!result.success) { - toast.error(result.message) - return - } - - props.onOpenChange?.(false) - toast.success(result.message) - onSuccess?.() - }) - } - - const attachmentText = attachments.length === 1 ? "첨부파일" : "첨부파일들" - const deleteWarning = `선택된 ${attachments.length}개의 ${attachmentText}과 모든 리비전이 영구적으로 삭제됩니다.` - - if (isDesktop) { - return ( - - {showTrigger ? ( - - - - ) : null} - - - 정말로 삭제하시겠습니까? - -
이 작업은 되돌릴 수 없습니다.
-
{deleteWarning}
- {attachments.length <= 3 && ( -
-
삭제될 파일:
-
    - {attachments.map((attachment) => ( -
  • - • {attachment.serialNo}: {attachment.originalFileName} ({attachment.currentRevision}) -
  • - ))} -
-
- )} -
-
- - - - - - -
-
- ) - } - - return ( - - {showTrigger ? ( - - - - ) : null} - - - 정말로 삭제하시겠습니까? - -
이 작업은 되돌릴 수 없습니다.
-
{deleteWarning}
- {attachments.length <= 3 && ( -
-
삭제될 파일:
-
    - {attachments.map((attachment) => ( -
  • - • {attachment.serialNo}: {attachment.originalFileName} ({attachment.currentRevision}) -
  • - ))} -
-
- )} -
-
- - - - - - -
-
- ) -} \ No newline at end of file -- cgit v1.2.3