diff --git a/apps/frontend/app/(client)/(main)/(create)/problem/create/_components/ProblemCreateContainer.tsx b/apps/frontend/app/(client)/(main)/(create)/problem/create/_components/ProblemCreateContainer.tsx index 1b7e89f4e2..9c58abfd9a 100644 --- a/apps/frontend/app/(client)/(main)/(create)/problem/create/_components/ProblemCreateContainer.tsx +++ b/apps/frontend/app/(client)/(main)/(create)/problem/create/_components/ProblemCreateContainer.tsx @@ -99,7 +99,8 @@ export function ProblemCreateContainer() { const [tab, setTab] = useState('Statement') return ( -
+ // TODO: statement 머지하기 전에 bg 속성 삭제 +

PROBLEM CREATE

@@ -107,14 +108,17 @@ export function ProblemCreateContainer() {

{problemProgress.toUpperCase()} @@ -137,7 +141,7 @@ export function ProblemCreateContainer() { setChecklistCnt((prev) => (prev > 5 ? prev - 1 : prev + 1)) } type="button" - className="itmes-center border-primary-light hover:bg-color-blue-95 flex h-12 gap-[6px] rounded-lg border-[1.4px] bg-white px-5 py-[13px]" + className="border-primary-light hover:bg-color-blue-95 flex h-12 items-center gap-[6px] rounded-lg border-[1.4px] bg-white px-5 py-[13px]" > This is Statement page

+ const sampleIdRef = useRef(1) + + const { control, register, handleSubmit } = useForm({ + defaultValues: { + basicInfo: { + title: '', + timeLimit: undefined, + memoryLimit: undefined + }, + problemInfo: { + description: '', + input: '', + output: '' + }, + samples: [ + { + sampleId: 1, + input: '', + output: '' + } + ] + } + }) + + const { fields, append, remove } = useFieldArray({ + control, + name: 'samples' + }) + + // TODO: 올바른 제출 로직 구현 (추후 백엔드 연동 시) + const submitForm = handleSubmit((data) => { + console.log(data) + }) + + const appendSample = () => { + append({ sampleId: ++sampleIdRef.current, input: '', output: '' }) + } + + const removeSample = (idx: number) => { + remove(idx) + } + + return ( +
+
+
+
+ 기본 정보 +
+
+
+ + ( + + )} + /> +
+
+
+ + ( + + )} + /> +
+
+ + ( + + )} + /> +
+
+
+
+
+
+ 문제 +
+
+
+ +