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(() => { console.log(whyCantCreatePublic) if (Object.values(whyCantCreatePublic).length===0) { console.log("нет проблем") updateModalInfoWhyCantCreate(false) } }, [openModalInfoWhyCantCreate]) return ( updateModalInfoWhyCantCreate(false)}> {Object.values(whyCantCreatePublic).map((data) => { return ( {data.name === "quiz" ? "У квиза" : `У вопроса "${data.name}"`} {data.problems.map((problem) => ( {problem} ))} ); })} ); };