import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
import React from "react";
import SettingIcon from "../../assets/icons/questionsPage/settingIcon";
import Clue from "../../assets/icons/questionsPage/clue";
import Branching from "../../assets/icons/questionsPage/branching";
import { Box, IconButton, Tooltip, Typography, useMediaQuery, useTheme } from "@mui/material";
import HideIcon from "../../assets/icons/questionsPage/hideIcon";
import CopyIcon from "../../assets/icons/questionsPage/CopyIcon";
import DeleteIcon from "../../assets/icons/questionsPage/deleteIcon";
import ImgIcon from "../../assets/icons/questionsPage/imgIcon";
import { useParams } from "react-router-dom";
import { questionStore, copyQuestion, removeQuestion, resetSomeField } from "@root/questions";
import "./ButtonsOptionsAndPict.css";
interface Props {
switchState: string;
SSHC: (data: string) => void;
totalIndex: number;
}
export default function ButtonsOptionsAndPict({ SSHC, switchState, totalIndex }: Props) {
const quizId = Number(useParams().quizId);
const { openedModalSettings } = questionStore();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(790));
const isIconMobile = useMediaQuery(theme.breakpoints.down(930));
const openedModal = () => {
resetSomeField({ openedModalSettings: "open" });
};
return (
{
SSHC("setting");
}}
sx={{
minWidth: isIconMobile ? "30px" : "64px",
height: "30px",
backgroundColor: switchState === "setting" ? theme.palette.brightPurple.main : "transparent",
color: switchState === "setting" ? "#ffffff" : theme.palette.grey3.main,
}}
>
{isIconMobile ? null : " Настройки"}
{
SSHC("help");
}}
sx={{
minWidth: isIconMobile ? "30px" : "64px",
height: "30px",
backgroundColor: switchState === "help" ? theme.palette.brightPurple.main : "transparent",
color: switchState === "help" ? "#ffffff" : theme.palette.grey3.main,
}}
>
{isIconMobile ? null : " Помощь"}
Будет показан при условии
Название
Условие 1, Условие 2
Все условия обязательны
}
>
{
SSHC("branching");
openedModal();
}}
sx={{
height: "30px",
minWidth: isIconMobile ? "30px" : "64px",
backgroundColor: switchState === "branching" ? theme.palette.brightPurple.main : "transparent",
color: switchState === "branching" ? "#ffffff" : theme.palette.grey3.main,
}}
>
{isIconMobile ? null : "Ветвление"}
{
SSHC("image");
}}
sx={{
height: "30px",
minWidth: isIconMobile ? "30px" : "64px",
backgroundColor: switchState === "image" ? theme.palette.brightPurple.main : "transparent",
color: switchState === "image" ? "#ffffff" : theme.palette.grey3.main,
}}
>
{isIconMobile ? null : "Изображение"}
copyQuestion(quizId, totalIndex)}>
removeQuestion(quizId, totalIndex)}>
);
}