From 33be47506f0aa62b969d82521580a29e95080268 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 13 Aug 2025 11:05:09 +0000
Subject: (대표님) 입찰, 법무검토, EDP 변경사항 대응, dolce 개선, form-data
 개선, 정규업체 등록관리 추가 (최겸) pq 미사용 컴포넌트 및 페이지 제거, 파일
 라우트에 pq 적용
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../skip-reason-dialog.tsx                         | 98 ++++++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 components/vendor-regular-registrations/skip-reason-dialog.tsx

(limited to 'components/vendor-regular-registrations/skip-reason-dialog.tsx')

diff --git a/components/vendor-regular-registrations/skip-reason-dialog.tsx b/components/vendor-regular-registrations/skip-reason-dialog.tsx
new file mode 100644
index 00000000..f47d8929
--- /dev/null
+++ b/components/vendor-regular-registrations/skip-reason-dialog.tsx
@@ -0,0 +1,98 @@
+"use client";
+
+import {
+  Dialog,
+  DialogContent,
+  DialogHeader,
+  DialogTitle,
+  DialogFooter,
+} from "@/components/ui/dialog";
+import { Button } from "@/components/ui/button";
+import { Textarea } from "@/components/ui/textarea";
+import { Label } from "@/components/ui/label";
+import { useState } from "react";
+import { toast } from "sonner";
+
+interface SkipReasonDialogProps {
+  open: boolean;
+  onOpenChange: (open: boolean) => void;
+  title: string;
+  description: string;
+  onConfirm: (reason: string) => Promise<void>;
+  loading: boolean;
+}
+
+export function SkipReasonDialog({
+  open,
+  onOpenChange,
+  title,
+  description,
+  onConfirm,
+  loading,
+}: SkipReasonDialogProps) {
+  const [reason, setReason] = useState("");
+
+  const handleConfirm = async () => {
+    if (!reason.trim()) {
+      toast.error("Skip 사유를 입력해주세요.");
+      return;
+    }
+
+    try {
+      await onConfirm(reason.trim());
+      setReason(""); // 성공 시 초기화
+      onOpenChange(false);
+    } catch (error) {
+      // 에러는 상위 컴포넌트에서 처리
+    }
+  };
+
+  const handleCancel = () => {
+    setReason("");
+    onOpenChange(false);
+  };
+
+  return (
+    <Dialog open={open} onOpenChange={onOpenChange}>
+      <DialogContent className="sm:max-w-md">
+        <DialogHeader>
+          <DialogTitle>{title}</DialogTitle>
+        </DialogHeader>
+        
+        <div className="space-y-4">
+          <p className="text-sm text-muted-foreground">
+            {description}
+          </p>
+          
+          <div className="space-y-2">
+            <Label htmlFor="reason">Skip 사유</Label>
+            <Textarea
+              id="reason"
+              placeholder="Skip 사유를 입력해주세요..."
+              value={reason}
+              onChange={(e) => setReason(e.target.value)}
+              rows={4}
+              disabled={loading}
+            />
+          </div>
+        </div>
+
+        <DialogFooter>
+          <Button
+            variant="outline"
+            onClick={handleCancel}
+            disabled={loading}
+          >
+            취소
+          </Button>
+          <Button
+            onClick={handleConfirm}
+            disabled={loading || !reason.trim()}
+          >
+            {loading ? "처리 중..." : "확인"}
+          </Button>
+        </DialogFooter>
+      </DialogContent>
+    </Dialog>
+  );
+}
-- 
cgit v1.2.3

