import { useChatContext } from "../contexts/ChatContext.tsx";
import { Drawer } from "@mantine/core";
import Chat from "../../../components/Chat/Chat.tsx";


const ClientChatDrawer = () => {
    const { chat, setChat } = useChatContext();

    if (!chat) return;

    return (
        <Drawer
            opened={!!chat}
            onClose={() => setChat(null)}
            position={"right"}
            size={"calc(50vw)"}
            withCloseButton={false}
        >
            <Chat />
        </Drawer>
    );
};

export default ClientChatDrawer;
