frontPanel/src/pages/Questions/DataOptions/settingData.tsx
2023-09-05 19:34:52 +03:00

44 lines
1.6 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 InfoIcon from "../../../assets/icons/InfoIcon";
import { questionStore, updateQuestionsList } from "@root/questions";
type SettingsDataProps = {
totalIndex: number;
};
export default function SettingsData({ totalIndex }: SettingsDataProps) {
const { listQuestions } = questionStore();
return (
<Box sx={{ display: "flex" }}>
<Box sx={{ padding: "20px" }}>
<Typography>Настройки календаря</Typography>
<CustomCheckbox
label={"Выбор диапозона дат"}
checked={listQuestions[totalIndex].content.range}
handleChange={({ target }) => {
const clonContent = listQuestions[totalIndex].content;
clonContent.range = target.checked;
updateQuestionsList(totalIndex, { content: clonContent });
}}
/>
<CustomCheckbox
label={"Выбор времени"}
checked={listQuestions[totalIndex].content.time}
handleChange={({ target }) => {
const clonContent = listQuestions[totalIndex].content;
clonContent.time = target.checked;
updateQuestionsList(totalIndex, { content: clonContent });
}}
/>
</Box>
<Box sx={{ padding: "20px" }}>
<Typography>Настройки вопросов</Typography>
<CustomCheckbox label={"Необязательный вопрос"} />
<CustomCheckbox label={"Внутреннее название вопроса"} /> <InfoIcon />
</Box>
</Box>
);
}