import { QuizQuestionVarImg } from "@model/questionTypes/varimg";
import UploadImage from "../UploadImage";
import HelpQuestions from "../helpQuestions";
import SettingOptionsAndPict from "./SettingOptionsAndPict";

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

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