From f206943e0316a1096e33fc1568b89953f751cb08 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Mon, 30 Nov 2026 13:31:04 +0900 Subject: [PATCH] =?UTF-8?q?[ST]=20-=20feat:=20=ED=86=B5=EA=B3=84=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EB=A6=AC=ED=8F=AC=ED=8A=B8=20=EC=83=81?= =?UTF-8?q?=EB=8B=A8=20=EB=B0=98=EB=A0=A4=20=EA=B8=B0=EB=8A=A5=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=20=EB=B6=80=EB=B6=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../verification/RejectReasonInputDialog.tsx | 113 ++++++++++++++++++ .../StatisticsVerificationReport.tsx | 77 ++++++++++++ .../api/statistics-approval-service.ts | 10 ++ apps/st/src/entities/statistics/index.ts | 1 + .../model/statistics-approval-interface.ts | 16 +++ 5 files changed, 217 insertions(+) create mode 100644 apps/st/src/components/statistics/verification/RejectReasonInputDialog.tsx diff --git a/apps/st/src/components/statistics/verification/RejectReasonInputDialog.tsx b/apps/st/src/components/statistics/verification/RejectReasonInputDialog.tsx new file mode 100644 index 000000000..8d72df8aa --- /dev/null +++ b/apps/st/src/components/statistics/verification/RejectReasonInputDialog.tsx @@ -0,0 +1,113 @@ +"use client"; + +import { useEffect, useState } from "react"; + +import { + Button, + Dialog, + DialogClose, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + Label, + Textarea, +} from "@common/components"; + +export interface RejectReasonInputDialogProps { + open: boolean; + onOpenChange: (open: boolean) => void; + onConfirm?: (reason: string) => void | Promise; +} + +export function RejectReasonInputDialog({ + open, + onOpenChange, + onConfirm, +}: RejectReasonInputDialogProps) { + const [reason, setReason] = useState(""); + const [reasonError, setReasonError] = useState(false); + const [isSubmitting, setIsSubmitting] = useState(false); + + const resetForm = () => { + setReason(""); + setReasonError(false); + }; + + const handleDialogOpenChange = (nextOpen: boolean) => { + if (!nextOpen) resetForm(); + onOpenChange(nextOpen); + }; + + useEffect(() => { + if (!open) resetForm(); + }, [open]); + + const handleConfirm = async () => { + const trimmed = reason.trim(); + if (!trimmed) { + setReasonError(true); + return; + } + try { + setIsSubmitting(true); + await onConfirm?.(trimmed); + } finally { + setIsSubmitting(false); + } + }; + + const canSubmit = reason.trim().length > 0 && !isSubmitting; + + return ( + + + + 반려 + +
+
+ +