summaryrefslogtreecommitdiff
path: root/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx')
-rw-r--r--lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx b/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx
index e135d8b8..e22b9ca1 100644
--- a/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx
+++ b/lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx
@@ -11,6 +11,8 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog"
+import { Textarea } from "@/components/ui/textarea"
+import { Label } from "@/components/ui/label"
interface CancelInvestigationDialogProps {
isOpen: boolean
@@ -71,7 +73,7 @@ export function CancelInvestigationDialog({
interface ReRequestInvestigationDialogProps {
isOpen: boolean
onClose: () => void
- onConfirm: () => Promise<void>
+ onConfirm: (reason?: string) => Promise<void>
selectedCount: number
}
@@ -82,16 +84,24 @@ export function ReRequestInvestigationDialog({
selectedCount,
}: ReRequestInvestigationDialogProps) {
const [isPending, setIsPending] = React.useState(false)
+ const [reason, setReason] = React.useState("")
async function handleConfirm() {
setIsPending(true)
try {
- await onConfirm()
+ await onConfirm(reason || undefined)
} finally {
setIsPending(false)
}
}
+ // Dialog가 닫힐 때 상태 초기화
+ React.useEffect(() => {
+ if (!isOpen) {
+ setReason("")
+ }
+ }, [isOpen])
+
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}>
<DialogContent>
@@ -102,6 +112,21 @@ export function ReRequestInvestigationDialog({
취소 상태인 실사만 재의뢰할 수 있습니다.
</DialogDescription>
</DialogHeader>
+
+ <div className="space-y-4 py-4">
+ <div className="space-y-2">
+ <Label htmlFor="reason">재의뢰 사유 (선택)</Label>
+ <Textarea
+ id="reason"
+ placeholder="재의뢰 사유를 입력해주세요..."
+ value={reason}
+ onChange={(e) => setReason(e.target.value)}
+ rows={4}
+ disabled={isPending}
+ />
+ </div>
+ </div>
+
<DialogFooter>
<Button
type="button"