frontPanel/src/pages/Result/DescriptionForm/ButtinsOptionsForm.tsx

87 lines
2.5 KiB
TypeScript
Raw Normal View History

2023-04-15 09:10:59 +00:00
import React from "react";
2023-04-23 08:39:34 +00:00
import { Box, IconButton, useTheme } from "@mui/material";
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
import SettingIcon from "@icons/questionsPage/settingIcon";
import Branching from "@icons/questionsPage/branching";
2023-09-25 13:43:15 +00:00
import { HideIcon } from "@icons/questionsPage/hideIcon";
import { CopyIcon } from "@icons/questionsPage/CopyIcon";
import { DeleteIcon } from "@icons/questionsPage/deleteIcon";
2023-04-15 09:10:59 +00:00
import StarIconPoints from "./StarIconsPoints";
interface Props {
switchState: string;
SSHC: (data: string) => void;
}
export default function ButtonsOptionsForm({ SSHC, switchState }: Props) {
const theme = useTheme();
2023-04-23 08:39:34 +00:00
2023-04-15 09:10:59 +00:00
const buttonSetting: { icon: JSX.Element; title: string; value: string }[] = [
{
icon: <SettingIcon color={switchState === "setting" ? "#ffffff" : theme.palette.grey3.main} />,
title: "Настройки",
value: "setting",
},
{
icon: <Branching color={switchState === "branching" ? "#ffffff" : theme.palette.grey3.main} />,
title: "Ветвление",
value: "branching",
},
{
icon: <StarIconPoints color={switchState === "points" ? "#ffffff" : theme.palette.grey3.main} />,
2023-04-15 09:10:59 +00:00
title: "Баллы",
value: "points",
},
];
return (
<Box
sx={{
display: "flex",
justifyContent: "space-between",
width: "100%",
background: "#F2F3F7",
}}
>
<Box
sx={{
padding: "20px",
display: "flex",
gap: "10px",
}}
>
2023-04-23 08:39:34 +00:00
{buttonSetting.map(({ icon, title, value }, index) => (
2023-04-15 09:10:59 +00:00
<MiniButtonSetting
2023-04-23 08:39:34 +00:00
key={index}
2023-04-15 09:10:59 +00:00
onClick={() => {
2023-04-23 08:39:34 +00:00
SSHC(value);
2023-04-15 09:10:59 +00:00
}}
sx={{
2023-04-23 08:39:34 +00:00
backgroundColor: switchState === value ? theme.palette.brightPurple.main : "transparent",
color: switchState === value ? "#ffffff" : theme.palette.grey3.main,
2023-04-15 09:10:59 +00:00
}}
>
2023-04-23 08:39:34 +00:00
{icon}
{title}
2023-04-15 09:10:59 +00:00
</MiniButtonSetting>
))}
</Box>
<Box
sx={{
padding: "20px",
}}
>
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
2023-09-25 13:43:15 +00:00
<HideIcon style={{ color: "#4D4D4D" }} />
2023-04-15 09:10:59 +00:00
</IconButton>
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
2023-09-25 13:43:15 +00:00
<CopyIcon style={{ color: "#4D4D4D" }} />
2023-04-15 09:10:59 +00:00
</IconButton>
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
2023-09-25 13:43:15 +00:00
<DeleteIcon style={{ color: "#4D4D4D" }} />
2023-04-15 09:10:59 +00:00
</IconButton>
</Box>
</Box>
);
}