import { useContext } from "react";
import { useCourseEditor } from "../../context/CourseEditorContext";
import { CoursePart } from "../enum";
import { CourseBasicForm } from "./CourseBasicForm";
import { CourseTargetForm } from "./CourseTargetForm";
import { CourseContentForm } from "./CourseContentForm";

export default function CourseForm() {
	const { part } = useCourseEditor();
	if (part === CoursePart.OVERVIEW) {
		return <CourseBasicForm></CourseBasicForm>;
	}
	if (part === CoursePart.TARGET) {
		return <CourseTargetForm></CourseTargetForm>;
	}
	if (part === CoursePart.CONTENT) {
		return <CourseContentForm></CourseContentForm>;
	}
	if (part === CoursePart.SETTING) {
		return <></>;
	}
	return <CourseBasicForm></CourseBasicForm>;
}
