import { QuizQuestionText } from "@model/questionTypes/text";
import HelpQuestions from "../helpQuestions";
import SettingTextField from "./settingTextField";
import UploadImage from "../UploadImage";

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

export default function SwitchTextField({
  switchState = "setting",
  question,
}: Props) {
  switch (switchState) {
    case "setting":
      return (
        <SettingTextField
          questionId={question.id}
          isRequired={question.content.required}
        />
      );
    case "image":
      return <UploadImage question={question} />;
    case "help":
      return (
        <HelpQuestions
          questionId={question.id}
          hintText={question.content.hint.text}
          hintVideo={question.content.hint.video}
        />
      );
    default:
      return <></>;
  }
}
