import { QuizQuestionVariant } from "@frontend/squzanswerer";
import UploadImage from "../../UploadImage";
import HelpQuestions from "../../helpQuestions";
import ResponseSettings from "./responseSettings";

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

export default function SwitchAnswerOptions({ switchState = "setting", question }: Props) {
  switch (switchState) {
    case "setting":
      return (
        <ResponseSettings
          question={question}
          questionId={question.id}
          isRequired={question.content.required}
          isLargeCheck={question.content.largeCheck}
          isMulti={question.content.multi}
          isOwn={question.content.own}
          isOwnPlaceholder={question.content.ownPlaceholder}
        />
      );
    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;
  }
}
