import { QuizQuestionDate } from "@frontend/squzanswerer";
import HelpQuestions from "../../helpQuestions";
import SettingData from "./settingData";

interface Props {
  switchState: string;
  question: QuizQuestionDate;
}

export default function SwitchData({ switchState = "setting", question }: Props) {
  switch (switchState) {
    case "setting":
      return (
        <SettingData
          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 <></>;
  }
}
