diff --git a/components/ChatView/Header.tsx b/components/ChatView/Header.tsx index f58aa12..1276cb8 100644 --- a/components/ChatView/Header.tsx +++ b/components/ChatView/Header.tsx @@ -1,41 +1,31 @@ -import { Menu } from "@headlessui/react"; -import { toast } from "react-hot-toast"; -import { useChatStore, useMessageStore } from "@/store"; +import { useEffect } from "react"; +import { useChatStore } from "@/store"; import Icon from "../Icon"; const Header = () => { const chatStore = useChatStore(); - const messageStore = useMessageStore(); const currentChat = chatStore.currentChat; + const title = currentChat?.title || "SQL Chat"; - const handleClearMessage = () => { - messageStore.clearMessage((message) => message.chatId !== currentChat?.id); - toast.success("Message cleared"); - }; + useEffect(() => { + document.title = `${title} - SQL Chat`; + }, [title]); return ( -
+
- {currentChat?.title || "SQL Chat"} -
- - - - - - -
- - Clear -
-
-
-
+ {title} +
+ + Crafted by + +
); diff --git a/components/ConnectionSidebar.tsx b/components/ConnectionSidebar.tsx index 1eda306..1f2bb6e 100644 --- a/components/ConnectionSidebar.tsx +++ b/components/ConnectionSidebar.tsx @@ -1,5 +1,4 @@ import { head } from "lodash-es"; -import Link from "next/link"; import { useEffect, useState } from "react"; import { createPortal } from "react-dom"; import { useChatStore, useConnectionStore } from "@/store"; @@ -65,19 +64,21 @@ const ConnectionSidebar = () => { return ( <>