frontPanel/src/pages/Questions/DropDown/settingDropDown.tsx
2023-08-25 13:27:43 +03:00

50 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Box, Typography } from "@mui/material";
import CustomCheckbox from "@ui_kit/CustomCheckbox";
import CustomTextField from "@ui_kit/CustomTextField";
import { questionStore, updateQuestionsList } from "@root/questions";
import InfoIcon from "../../../assets/icons/InfoIcon";
type SettingDropDownProps = {
totalIndex: number;
};
export default function SettingDropDown({ totalIndex }: SettingDropDownProps) {
const { listQuestions } = questionStore();
return (
<>
<Box
sx={{ display: "flex", width: "100%", justifyContent: "space-between" }}
>
<Box sx={{ padding: "20px", width: "100%" }}>
<Typography sx={{ marginBottom: "15px" }}>
Настройки ответов
</Typography>
<CustomCheckbox label={"Можно несколько"} />
<Typography sx={{ marginBottom: "15px" }}>
Текст в выпадающем списке
</Typography>
<CustomTextField
placeholder={"Выберите вариант"}
text={listQuestions[totalIndex].content.default}
onChange={({ target }) => {
const clonContent = listQuestions[totalIndex].content;
clonContent.default = target.value;
updateQuestionsList(totalIndex, { content: clonContent });
}}
/>
</Box>
<Box sx={{ padding: "20px" }}>
<Typography sx={{ marginBottom: "15px" }}>
Настройки вопросов
</Typography>
<CustomCheckbox label={"Необязательный вопрос"} />
<CustomCheckbox label={"Внутреннее название вопроса"} /> <InfoIcon />
</Box>
</Box>
</>
);
}