From a50bc9baea332f996e6bc3a5d70c69f6d2d0f194 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 23 Jul 2025 09:08:03 +0000
Subject: (대표님, 최겸) 기본계약 템플릿 및 에디터, 기술영업 벤더정보, 파일
 보안다운로드, 벤더 document sync 상태 서비스, 메뉴 Config, 기술영업 미사용
 제거
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/delete-candidates-dialog.tsx             | 159 ---------------------
 1 file changed, 159 deletions(-)
 delete mode 100644 lib/tech-vendor-candidates/table/delete-candidates-dialog.tsx

(limited to 'lib/tech-vendor-candidates/table/delete-candidates-dialog.tsx')

diff --git a/lib/tech-vendor-candidates/table/delete-candidates-dialog.tsx b/lib/tech-vendor-candidates/table/delete-candidates-dialog.tsx
deleted file mode 100644
index bc231109..00000000
--- a/lib/tech-vendor-candidates/table/delete-candidates-dialog.tsx
+++ /dev/null
@@ -1,159 +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 { removeCandidates } from "../service"
-import { VendorCandidatesWithVendorInfo } from "@/db/schema"
-import { useSession } from "next-auth/react" // next-auth 세션 훅
-
-interface DeleteCandidatesDialogProps
-  extends React.ComponentPropsWithoutRef<typeof Dialog> {
-  candidates: Row<VendorCandidatesWithVendorInfo>["original"][]
-  showTrigger?: boolean
-  onSuccess?: () => void
-}
-
-export function DeleteCandidatesDialog({
-  candidates,
-  showTrigger = true,
-  onSuccess,
-  ...props
-}: DeleteCandidatesDialogProps) {
-  const [isDeletePending, startDeleteTransition] = React.useTransition()
-  const isDesktop = useMediaQuery("(min-width: 640px)")
-  const { data: session, status } = useSession()
-
-  function onDelete() {
-    startDeleteTransition(async () => {
-
-      if (!session?.user?.id) {
-        toast.error("인증 오류. 로그인 정보를 찾을 수 없습니다.")
-        return
-      }
-
-      const userId = Number(session.user.id)
-
-      const { error } = await removeCandidates({
-        ids: candidates.map((candidate) => candidate.id),
-      }, userId)
-
-      if (error) {
-        toast.error(error)
-        return
-      }
-
-      props.onOpenChange?.(false)
-      toast.success("Candidates deleted")
-      onSuccess?.()
-    })
-  }
-
-  if (isDesktop) {
-    return (
-      <Dialog {...props}>
-        {showTrigger ? (
-          <DialogTrigger asChild>
-            <Button variant="outline" size="sm">
-              <Trash className="mr-2 size-4" aria-hidden="true" />
-              Delete ({candidates.length})
-            </Button>
-          </DialogTrigger>
-        ) : null}
-        <DialogContent>
-          <DialogHeader>
-            <DialogTitle>Are you absolutely sure?</DialogTitle>
-            <DialogDescription>
-              This action cannot be undone. This will permanently delete your{" "}
-              <span className="font-medium">{candidates.length}</span>
-              {candidates.length === 1 ? " candidate" : " candidates"} from our servers.
-            </DialogDescription>
-          </DialogHeader>
-          <DialogFooter className="gap-2 sm:space-x-0">
-            <DialogClose asChild>
-              <Button variant="outline">Cancel</Button>
-            </DialogClose>
-            <Button
-              aria-label="Delete selected rows"
-              variant="destructive"
-              onClick={onDelete}
-              disabled={isDeletePending}
-            >
-              {isDeletePending && (
-                <Loader
-                  className="mr-2 size-4 animate-spin"
-                  aria-hidden="true"
-                />
-              )}
-              Delete
-            </Button>
-          </DialogFooter>
-        </DialogContent>
-      </Dialog>
-    )
-  }
-
-  return (
-    <Drawer {...props}>
-      {showTrigger ? (
-        <DrawerTrigger asChild>
-          <Button variant="outline" size="sm">
-            <Trash className="mr-2 size-4" aria-hidden="true" />
-            Delete ({candidates.length})
-          </Button>
-        </DrawerTrigger>
-      ) : null}
-      <DrawerContent>
-        <DrawerHeader>
-          <DrawerTitle>Are you absolutely sure?</DrawerTitle>
-          <DrawerDescription>
-            This action cannot be undone. This will permanently delete your{" "}
-            <span className="font-medium">{candidates.length}</span>
-            {candidates.length === 1 ? " candidate" : " candidates"} from our servers.
-          </DrawerDescription>
-        </DrawerHeader>
-        <DrawerFooter className="gap-2 sm:space-x-0">
-          <DrawerClose asChild>
-            <Button variant="outline">Cancel</Button>
-          </DrawerClose>
-          <Button
-            aria-label="Delete selected rows"
-            variant="destructive"
-            onClick={onDelete}
-            disabled={isDeletePending}
-          >
-            {isDeletePending && (
-              <Loader className="mr-2 size-4 animate-spin" aria-hidden="true" />
-            )}
-            Delete
-          </Button>
-        </DrawerFooter>
-      </DrawerContent>
-    </Drawer>
-  )
-}
-- 
cgit v1.2.3

