33 lines
831 B
TypeScript
33 lines
831 B
TypeScript
import { QuizQuestionDate } from "@frontend/squzanswerer";
|
|
import HelpQuestions from "../../helpQuestions";
|
|
import SettingDate from "./settingDate";
|
|
|
|
interface Props {
|
|
switchState: string;
|
|
question: QuizQuestionDate;
|
|
}
|
|
|
|
export default function SwitchData({ switchState = "setting", question }: Props) {
|
|
switch (switchState) {
|
|
case "setting":
|
|
return (
|
|
<SettingDate
|
|
questionId={question.id}
|
|
isRequired={question.content.required}
|
|
isDateRange={question.content.dateRange}
|
|
isTime={question.content.time}
|
|
/>
|
|
);
|
|
case "help":
|
|
return (
|
|
<HelpQuestions
|
|
questionId={question.id}
|
|
hintText={question.content.hint.text}
|
|
hintVideo={question.content.hint.video}
|
|
/>
|
|
);
|
|
default:
|
|
return <></>;
|
|
}
|
|
}
|