import { QuizQuestionVarImg } from "@frontend/squzanswerer";
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
          question={question}
          questionId={question.id}
          replText={question.content.replText}
          isRequired={question.content.required}
          isOwn={question.content.own}
          isLargeCheck={question.content.largeCheck}
          isMulti={question.content.multi}
        />
      );
    case "help":
      return (
        <HelpQuestions
          questionId={question.id}
          hintText={question.content.hint.text}
          hintVideo={question.content.hint.video}
        />
      );
    case "image":
      return (
        <UploadImage
          question={question}
          cropAspectRatio={{ width: 380, height: 300 }}
        />
      );
    default:
      return null;
  }
}
