44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
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) {
|
|
console.log(question)
|
|
switch (switchState) {
|
|
case "setting":
|
|
return (
|
|
<SettingOptionsAndPict
|
|
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;
|
|
}
|
|
}
|