2023-03-15 22:56:53 +00:00
|
|
|
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
|
|
|
|
import React from "react";
|
|
|
|
import SettingIcon from "../../components/icons/questionsPage/settingIcon";
|
|
|
|
import Clue from "../../components/icons/questionsPage/clue";
|
|
|
|
import Branching from "../../components/icons/questionsPage/branching";
|
|
|
|
import ImgIcon from "../../components/icons/questionsPage/imgIcon";
|
|
|
|
import {Box, IconButton, useTheme} from "@mui/material";
|
|
|
|
import HideIcon from "../../components/icons/questionsPage/hideIcon";
|
|
|
|
import CopyIcon from "../../components/icons/questionsPage/CopyIcon";
|
|
|
|
import DeleteIcon from "../../components/icons/questionsPage/deleteIcon";
|
|
|
|
|
2023-03-18 21:35:09 +00:00
|
|
|
interface Props {
|
|
|
|
switchState: string
|
|
|
|
SSHC: (data:string) => void
|
|
|
|
}
|
2023-03-15 22:56:53 +00:00
|
|
|
|
2023-03-18 21:35:09 +00:00
|
|
|
export default function ButtonsOptions ({SSHC, switchState}:Props) {
|
|
|
|
const buttonSetting: {icon: JSX.Element; title: string; value: string} [] =[
|
|
|
|
{icon: <SettingIcon/>, title: 'Настройки', value: 'setting'},
|
|
|
|
{icon: <Clue/>, title: 'Подсказка', value: 'help'},
|
|
|
|
{icon: <Branching/>, title: 'Ветвление', value: 'branching'},
|
|
|
|
{icon: <ImgIcon/>, title: 'Изображение', value: 'image'},
|
|
|
|
]
|
2023-03-15 22:56:53 +00:00
|
|
|
const theme = useTheme();
|
|
|
|
return (
|
|
|
|
<Box sx={{
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
width: '100%',
|
|
|
|
background: '#f2f3f7'
|
|
|
|
}}>
|
|
|
|
<Box
|
|
|
|
sx={{
|
|
|
|
padding: '20px',
|
|
|
|
display: 'flex',
|
|
|
|
gap: '10px'
|
|
|
|
}}
|
|
|
|
>
|
2023-03-18 21:35:09 +00:00
|
|
|
{buttonSetting.map( (e,i) => (
|
|
|
|
<MiniButtonSetting
|
|
|
|
key={i}
|
|
|
|
onClick={()=>{SSHC(e.value)}}
|
|
|
|
sx={{backgroundColor: switchState === e.value ? theme.palette.brightPurple.main : 'transparent',
|
|
|
|
color: switchState === e.value ? '#ffffff' : theme.palette.grey3.main,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{e.icon}
|
|
|
|
{e.title}
|
|
|
|
</MiniButtonSetting>
|
|
|
|
))}
|
2023-03-15 22:56:53 +00:00
|
|
|
</Box>
|
|
|
|
<Box
|
|
|
|
sx={{
|
|
|
|
padding: '20px',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<IconButton sx={{borderRadius: '6px', padding: '2px'}}>
|
|
|
|
<HideIcon/>
|
|
|
|
</IconButton>
|
|
|
|
<IconButton sx={{borderRadius: '6px', padding: '2px'}}>
|
|
|
|
<CopyIcon/>
|
|
|
|
</IconButton>
|
|
|
|
<IconButton sx={{borderRadius: '6px', padding: '2px'}}>
|
|
|
|
<DeleteIcon/>
|
|
|
|
</IconButton>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
)
|
|
|
|
}
|