import { Box, Modal, Typography, Divider } from "@mui/material"; import { useUiTools } from "@root/uiTools/store"; import { updateModalInfoWhyCantCreate } from "@root/uiTools/actions"; import { useLayoutEffect } from "react"; export const ModalInfoWhyCantCreate = () => { const { whyCantCreatePublic, openModalInfoWhyCantCreate } = useUiTools(); useLayoutEffect(() => { if (Object.values(whyCantCreatePublic).length === 0) { updateModalInfoWhyCantCreate(false); } }, [openModalInfoWhyCantCreate]); return ( updateModalInfoWhyCantCreate(false)} > {Object.values(whyCantCreatePublic).map((data) => { return ( {data.name === "quiz" ? "У квиза" : `У вопроса "${data.name}"`} {data.problems.map((problem) => ( {problem} ))} ); })} ); };