frontPanel/src/pages/Questions/DropDown/settingDropDown.tsx

50 lines
1.7 KiB
TypeScript
Raw Normal View History

2023-08-25 10:27:43 +00:00
import { Box, Typography } from "@mui/material";
import CustomCheckbox from "@ui_kit/CustomCheckbox";
import CustomTextField from "@ui_kit/CustomTextField";
2023-08-25 10:27:43 +00:00
import { questionStore, updateQuestionsList } from "@root/questions";
import InfoIcon from "../../../assets/icons/InfoIcon";
2023-08-25 10:27:43 +00:00
type SettingDropDownProps = {
totalIndex: number;
};
export default function SettingDropDown({ totalIndex }: SettingDropDownProps) {
const { listQuestions } = questionStore();
2023-08-25 10:27:43 +00:00
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>
</>
);
}