2023-04-11 18:29:38 +00:00
|
|
|
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
|
|
|
|
import React from "react";
|
2023-05-03 19:21:00 +00:00
|
|
|
import SettingIcon from "../../assets/icons/questionsPage/settingIcon";
|
|
|
|
import Branching from "../../assets/icons/questionsPage/branching";
|
2023-09-15 12:37:12 +00:00
|
|
|
import { Box, useTheme } from "@mui/material";
|
2023-05-03 19:21:00 +00:00
|
|
|
import SupplementIcon from "../../assets/icons/ContactFormIcon/supplementIcon";
|
2023-04-11 18:29:38 +00:00
|
|
|
|
|
|
|
interface Props {
|
2023-09-15 12:37:12 +00:00
|
|
|
switchState: string;
|
|
|
|
SSHC: (data: string) => void;
|
2023-04-11 18:29:38 +00:00
|
|
|
}
|
|
|
|
|
2023-09-15 12:37:12 +00:00
|
|
|
export default function ButtonSettingForms({ SSHC, switchState }: Props) {
|
|
|
|
const theme = useTheme();
|
|
|
|
const buttonSetting: { icon: JSX.Element; title: string; value: string }[] = [
|
|
|
|
{
|
2023-12-31 02:53:25 +00:00
|
|
|
icon: (
|
|
|
|
<SettingIcon
|
|
|
|
color={
|
|
|
|
switchState === "setting" ? "#ffffff" : theme.palette.grey3.main
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
),
|
2023-09-15 12:37:12 +00:00
|
|
|
title: "Настройки",
|
|
|
|
value: "setting",
|
|
|
|
},
|
|
|
|
{
|
2023-12-31 02:53:25 +00:00
|
|
|
icon: (
|
|
|
|
<Branching
|
|
|
|
color={
|
|
|
|
switchState === "branching" ? "#ffffff" : theme.palette.grey3.main
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
),
|
2023-09-15 12:37:12 +00:00
|
|
|
title: "Ветвление",
|
|
|
|
value: "branching",
|
|
|
|
},
|
|
|
|
{
|
2023-12-31 02:53:25 +00:00
|
|
|
icon: (
|
|
|
|
<SupplementIcon
|
|
|
|
color={
|
|
|
|
switchState === "supplement" ? "#ffffff" : theme.palette.grey3.main
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
),
|
2023-09-15 12:37:12 +00:00
|
|
|
title: "Добавить шаг формы",
|
|
|
|
value: "supplement",
|
|
|
|
},
|
|
|
|
];
|
2023-04-11 18:29:38 +00:00
|
|
|
|
2023-09-15 12:37:12 +00:00
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
sx={{
|
|
|
|
display: "flex",
|
|
|
|
justifyContent: "space-between",
|
|
|
|
width: "100%",
|
|
|
|
background: "#f2f3f7",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Box
|
|
|
|
sx={{
|
|
|
|
padding: "20px",
|
|
|
|
display: "flex",
|
|
|
|
gap: "10px",
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{buttonSetting.map((e, i) => (
|
|
|
|
<MiniButtonSetting
|
|
|
|
key={i}
|
|
|
|
onClick={() => {
|
|
|
|
SSHC(e.value);
|
|
|
|
}}
|
|
|
|
sx={{
|
2023-12-31 02:53:25 +00:00
|
|
|
backgroundColor:
|
|
|
|
switchState === e.value
|
|
|
|
? theme.palette.brightPurple.main
|
|
|
|
: "transparent",
|
|
|
|
color:
|
|
|
|
switchState === e.value ? "#ffffff" : theme.palette.grey3.main,
|
2023-09-15 12:37:12 +00:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
{e.icon}
|
|
|
|
{e.title}
|
|
|
|
</MiniButtonSetting>
|
|
|
|
))}
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|