diff options
| author | joonhoekim <26rote@gmail.com> | 2025-10-23 18:13:41 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-10-23 18:13:41 +0900 |
| commit | 78c471eec35182959e0029ded18f144974ccaca2 (patch) | |
| tree | 914cdf1c8f406ca3e2aa639b8bb774f7f4e87023 /lib/pq/pq-review-table-new/cancel-investigation-dialog.tsx | |
| parent | 0be8940580c4a4a4e098b649d198160f9b60420c (diff) | |
(김준회) 결재 템플릿 에디터 및 결재 워크플로 공통함수 작성, 실사의뢰 결재 연결 예시 작성
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.tsx | 29 |
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"
|
