2024-06-19 20:22:37 +00:00
|
|
|
import { QuizQuestionDate } from "@frontend/squzanswerer";
|
2024-09-02 20:48:06 +00:00
|
|
|
import HelpQuestions from "../../helpQuestions";
|
2024-09-07 19:57:11 +00:00
|
|
|
import SettingDate from "./settingDate";
|
2023-11-16 16:41:25 +00:00
|
|
|
|
2023-03-31 15:48:49 +00:00
|
|
|
interface Props {
|
2023-08-24 11:09:47 +00:00
|
|
|
switchState: string;
|
2023-11-16 16:41:25 +00:00
|
|
|
question: QuizQuestionDate;
|
2023-03-31 15:48:49 +00:00
|
|
|
}
|
|
|
|
|
|
2024-05-29 16:41:41 +00:00
|
|
|
export default function SwitchData({ switchState = "setting", question }: Props) {
|
2023-08-24 11:09:47 +00:00
|
|
|
switch (switchState) {
|
|
|
|
|
case "setting":
|
2024-05-29 16:41:41 +00:00
|
|
|
return (
|
2024-09-07 19:57:11 +00:00
|
|
|
<SettingDate
|
2024-05-29 16:41:41 +00:00
|
|
|
questionId={question.id}
|
|
|
|
|
isRequired={question.content.required}
|
|
|
|
|
isDateRange={question.content.dateRange}
|
|
|
|
|
isTime={question.content.time}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2023-08-24 11:09:47 +00:00
|
|
|
case "help":
|
2024-02-29 11:23:52 +00:00
|
|
|
return (
|
|
|
|
|
<HelpQuestions
|
|
|
|
|
questionId={question.id}
|
|
|
|
|
hintText={question.content.hint.text}
|
|
|
|
|
hintVideo={question.content.hint.video}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2023-08-24 11:09:47 +00:00
|
|
|
default:
|
|
|
|
|
return <></>;
|
|
|
|
|
}
|
|
|
|
|
}
|