import { useState } from "react"; import { Box, Button, IconButton, SxProps, Theme, Typography, useTheme, useMediaQuery, } from "@mui/material"; import { SwitchSetting } from "./SwichResult"; import Info from "@icons/Info"; import listChecks from "@icons/listChecks.svg"; import ShareNetwork from "@icons/ShareNetwork.svg"; import ArrowCounterClockWise from "@icons/ArrowCounterClockWise.svg"; const buttonSetting: { title: string; sx: SxProps; type: string }[] = [ { sx: { backgroundColor: "#7E2AEA", color: "white", width: "237px", height: "44px", border: "1px solid #9A9AAF", }, title: "До формы контактов", type: "toContactForm", }, { sx: { backgroundColor: "#F2F3F7", color: "#9A9AAF", width: "266px", height: "44px", border: "1px solid #9A9AAF", }, title: "После формы контактов", type: "afterСontactForm", }, { sx: { color: "#9A9AAF", backgroundColor: "#F2F3F7", width: "233px", height: "44px", border: "1px solid #9A9AAF", }, title: "Отправить на E-mail", type: "e-mail", }, ]; export const SettingForm = () => { const [activeIndex, setActiveIndex] = useState(0); const [typeActive, setTypeActive] = useState("toContactForm"); const theme = useTheme(); const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1100)); const active = (index: number, type: string) => { setActiveIndex(index); setTypeActive(type); }; return ( Настройки результатов Показывать результат {buttonSetting.map(({ sx, title, type }, index) => ( ))} {typeActive === "e-mail" ? ( ) : ( <> )} Создайте результат ); };