From 4c15b99d9586aa48693213c78c02fba4639ebb85 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 1 Jul 2025 11:47:47 +0000 Subject: (최겸) 인포메이션 기능 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/delete-information-dialog.tsx | 125 --------------------- 1 file changed, 125 deletions(-) delete mode 100644 lib/information/table/delete-information-dialog.tsx (limited to 'lib/information/table/delete-information-dialog.tsx') diff --git a/lib/information/table/delete-information-dialog.tsx b/lib/information/table/delete-information-dialog.tsx deleted file mode 100644 index e36d948d..00000000 --- a/lib/information/table/delete-information-dialog.tsx +++ /dev/null @@ -1,125 +0,0 @@ -"use client" - -import * as React from "react" -import { useRouter } from "next/navigation" -import { toast } from "sonner" -import { Loader, Trash2 } from "lucide-react" - -import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, -} from "@/components/ui/alert-dialog" -import { deleteInformation } from "@/lib/information/service" -import type { PageInformation } from "@/db/schema/information" - -interface DeleteInformationDialogProps { - open: boolean - onOpenChange: (open: boolean) => void - information?: PageInformation - onClose: () => void -} - -export function DeleteInformationDialog({ - open, - onOpenChange, - information, - onClose, -}: DeleteInformationDialogProps) { - const router = useRouter() - const [isLoading, setIsLoading] = React.useState(false) - - const handleDelete = async () => { - if (!information) return - - setIsLoading(true) - try { - const result = await deleteInformation(information.id) - - if (result.success) { - toast.success(result.message) - onClose() - router.refresh() - } else { - toast.error(result.message) - } - } catch (error) { - toast.error("인포메이션 삭제에 실패했습니다.") - console.error(error) - } finally { - setIsLoading(false) - } - } - - return ( - - - - - - 인포메이션 삭제 - - - 다음 인포메이션을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다. - - - - {information && ( -
-
-
- 페이지 코드: - {information.pageCode} -
-
- 페이지명: - {information.pageName} -
-
- 제목: - {information.title} -
- {information.noticeTitle && ( -
- 공지사항 제목: - {information.noticeTitle} -
- )} - {information.noticeContent && ( -
- 공지사항 내용: - {information.noticeContent} -
- )} - {information.attachmentFileName && ( -
- 첨부파일: - {information.attachmentFileName} -
- )} -
-
- )} - - - - 취소 - - - {isLoading && } - 삭제 - - -
-
- ) -} \ No newline at end of file -- cgit v1.2.3