"use client"; import { SidebarTrigger } from "@/components/ui/sidebar"; import { DownloadCloud } from "lucide-react"; import { useChatStore } from "@/stores/chatStore"; import { Button } from "@/components/ui/button"; import { useState } from "react"; const Topbar = () => { const { selectedChat, downloadChat } = useChatStore(); const [isDownloading, setIsDownloading] = useState(false); const chatTitle = selectedChat?.title || "New Chat"; const handleDownload = async () => { if (!selectedChat) return; setIsDownloading(true); try { await downloadChat(); } catch (error) { console.error("Download failed:", error); // You might want to show a toast notification here } finally { setIsDownloading(false); } }; return (

{chatTitle}

{/* Right side controls */} {selectedChat?.id && (
)}
); }; export default Topbar;