import { useState } from "react"; import { Box, Fab, Typography, Badge, useTheme } from "@mui/material"; import CircleDoubleDown from "./CircleDoubleDownIcon"; import Chat from "./Chat"; import { useUserStore } from "@root/stores/user"; import { useTicketStore } from "@root/stores/tickets"; export default function FloatingSupportChat() { const [isChatOpened, setIsChatOpened] = useState(false); const theme = useTheme(); const user = useUserStore((state) => state.user?._id); const { messages } = useTicketStore( (state) => state[user ? "authData" : "unauthData"] ); const animation = { "@keyframes runningStripe": { "0%": { left: "10%", backgroundColor: "transparent", }, "10%": { backgroundColor: "#ffffff", }, "50%": { backgroundColor: "#ffffff", transform: "translate(400px, 0)", }, "80%": { backgroundColor: "#ffffff", }, "100%": { backgroundColor: "transparent", boxShadow: "none", left: "100%", }, }, }; return ( setIsChatOpened((prev) => !prev)} > {!isChatOpened && ( )} shown.me !== 1).length} sx={{ "& .MuiBadge-badge": { display: isChatOpened ? "none" : "flex", color: "#FFFFFF", background: theme.palette.purple.main, }, }} > {!isChatOpened && ( Задайте нам вопрос )} ); }