diff --git a/components/custom/app-sidebar.tsx b/components/custom/app-sidebar.tsx index 971fb75..ae687ef 100644 --- a/components/custom/app-sidebar.tsx +++ b/components/custom/app-sidebar.tsx @@ -57,33 +57,6 @@ export function AppSidebar({ user }: { user: User | undefined }) { - - - - - Deploy - - - Deploy your own - - Open Source Chatbot template built with Next.js and the AI SDK - by Vercel. - - - - - - - - {user && ( diff --git a/components/custom/chat-header.tsx b/components/custom/chat-header.tsx index 8ec1268..29b13de 100644 --- a/components/custom/chat-header.tsx +++ b/components/custom/chat-header.tsx @@ -1,32 +1,54 @@ +'use client'; + import Link from 'next/link'; +import { useWindowSize } from 'usehooks-ts'; import { ModelSelector } from '@/components/custom/model-selector'; import { SidebarToggle } from '@/components/custom/sidebar-toggle'; import { Button } from '@/components/ui/button'; import { BetterTooltip } from '@/components/ui/tooltip'; -import { PlusIcon } from './icons'; +import { PlusIcon, VercelIcon } from './icons'; +import { useSidebar } from '../ui/sidebar'; export function ChatHeader({ selectedModelId }: { selectedModelId: string }) { + const { open } = useSidebar(); + + const { width: windowWidth } = useWindowSize(); + return ( -
+
- - - + {(!open || windowWidth < 768) && ( + + + + )} +
); } diff --git a/components/custom/chat.tsx b/components/custom/chat.tsx index 4edda69..12662b4 100644 --- a/components/custom/chat.tsx +++ b/components/custom/chat.tsx @@ -70,7 +70,7 @@ export function Chat({
{messages.length === 0 && } diff --git a/components/custom/icons.tsx b/components/custom/icons.tsx index 3dee5a8..9415a10 100644 --- a/components/custom/icons.tsx +++ b/components/custom/icons.tsx @@ -762,3 +762,18 @@ export const CopyIcon = ({ size = 16 }: { size?: number }) => ( > ); + +export const ChevronDownIcon = ({ size = 16 }: { size?: number }) => ( + + + +); diff --git a/components/custom/model-selector.tsx b/components/custom/model-selector.tsx index d2bb3ff..8a308c4 100644 --- a/components/custom/model-selector.tsx +++ b/components/custom/model-selector.tsx @@ -14,6 +14,8 @@ import { } from '@/components/ui/dropdown-menu'; import { cn } from '@/lib/utils'; +import { ChevronDownIcon } from './icons'; + export function ModelSelector({ selectedModelId, className, @@ -34,13 +36,13 @@ export function ModelSelector({ svg]:!size-5 md:[&>svg]:!size-4', + 'w-fit data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', className )} > - diff --git a/components/custom/sidebar-history.tsx b/components/custom/sidebar-history.tsx index ede893b..951a112 100644 --- a/components/custom/sidebar-history.tsx +++ b/components/custom/sidebar-history.tsx @@ -32,7 +32,6 @@ import { import { SidebarGroup, SidebarGroupContent, - SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuButton, @@ -136,12 +135,8 @@ export function SidebarHistory({ user }: { user: User | undefined }) { if (!user) { return ( -
- Today -
-
- +
Login to save and revisit previous chats!
@@ -181,18 +176,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) { if (history?.length === 0) { return ( -
- Today -
- - - - - No previous chats - - - +
+
+ Your conversations will appear here once you start chatting! +
+
); diff --git a/components/custom/sidebar-toggle.tsx b/components/custom/sidebar-toggle.tsx index 6bf5b1c..acb29fd 100644 --- a/components/custom/sidebar-toggle.tsx +++ b/components/custom/sidebar-toggle.tsx @@ -16,10 +16,10 @@ export function SidebarToggle({ );