import { Menu } from "@headlessui/react"; import Link from "next/link"; import { toast } from "react-hot-toast"; import { useChatStore, useMessageStore, useUserStore } from "../../store"; import Icon from "../Icon"; const Header = () => { const userStore = useUserStore(); const chatStore = useChatStore(); const messageStore = useMessageStore(); const currentChat = chatStore.currentChat; const chatTitle = currentChat ? userStore.getAssistantById(currentChat.assistantId)?.name : "No chat"; const handleClearMessage = () => { messageStore.clearMessage((message) => message.chatId !== currentChat?.id); toast.success("Message cleared"); }; return (