From 1a2241c40e10193c5ff7008a7b7b36cc1d855d96 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 25 Mar 2025 15:55:45 +0900 Subject: initial commit --- components/documents/RevisionForm.tsx | 115 ++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 components/documents/RevisionForm.tsx (limited to 'components/documents/RevisionForm.tsx') diff --git a/components/documents/RevisionForm.tsx b/components/documents/RevisionForm.tsx new file mode 100644 index 00000000..9eea04c5 --- /dev/null +++ b/components/documents/RevisionForm.tsx @@ -0,0 +1,115 @@ +"use client" + +import React, { useState } from "react" + +// shadcn/ui Components +import { Label } from "@/components/ui/label" +import { Input } from "@/components/ui/input" +import { Button } from "@/components/ui/button" +import { Separator } from "@/components/ui/separator" + +type RevisionFormProps = { + document: any +} + +export default function RevisionForm({ document }: RevisionFormProps) { + const [stage, setStage] = useState("") + const [revision, setRevision] = useState("") + const [planDate, setPlanDate] = useState("") + const [actualDate, setActualDate] = useState("") + const [file, setFile] = useState(null) + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + if (!document?.id) return + // server action 호출 예시 + // await createDocumentVersion({ + // documentId: document.id, + // stage, + // revision, + // planDate, + // actualDate, + // file, + // }); + alert("리비전이 등록되었습니다.") + // 이후 상태 초기화나 revalidation 등 필요에 따라 처리 + } + + return ( +
+

리비전 등록

+ + +
+ {/* Stage */} +
+ + setStage(e.target.value)} + /> +
+ + {/* Revision */} +
+ + setRevision(e.target.value)} + /> +
+ + {/* 계획일 */} +
+ + setPlanDate(e.target.value)} + /> +
+ + {/* 실제일 */} +
+ + setActualDate(e.target.value)} + /> +
+ + {/* 파일 업로드 */} +
+ + setFile(e.target.files?.[0] ?? null)} + /> +
+ + {/* 제출 버튼 */} + +
+
+ ) +} \ No newline at end of file -- cgit v1.2.3