From ccbc649317e3378115e2cc6e688432ea2b0d0c38 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 3 Apr 2025 01:05:07 -0700 Subject: [PATCH] feat: update chat greeting (#905) --- components/chat-header.tsx | 2 +- components/greeting.tsx | 29 ++++++++++++++++++ components/messages.tsx | 10 +++---- components/multimodal-input.tsx | 4 +-- components/overview.tsx | 52 --------------------------------- 5 files changed, 37 insertions(+), 60 deletions(-) create mode 100644 components/greeting.tsx delete mode 100644 components/overview.tsx diff --git a/components/chat-header.tsx b/components/chat-header.tsx index 9d595ef..003f880 100644 --- a/components/chat-header.tsx +++ b/components/chat-header.tsx @@ -11,7 +11,7 @@ import { PlusIcon, VercelIcon } from './icons'; import { useSidebar } from './ui/sidebar'; import { memo } from 'react'; import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'; -import { VisibilityType, VisibilitySelector } from './visibility-selector'; +import { type VisibilityType, VisibilitySelector } from './visibility-selector'; function PureChatHeader({ chatId, diff --git a/components/greeting.tsx b/components/greeting.tsx new file mode 100644 index 0000000..9543c77 --- /dev/null +++ b/components/greeting.tsx @@ -0,0 +1,29 @@ +import { motion } from 'framer-motion'; + +export const Greeting = () => { + return ( +
+ + Hello there! + + + How can I help you today? + +
+ ); +}; diff --git a/components/messages.tsx b/components/messages.tsx index 045f3ae..dbcb546 100644 --- a/components/messages.tsx +++ b/components/messages.tsx @@ -1,11 +1,11 @@ -import { UIMessage } from 'ai'; +import type { UIMessage } from 'ai'; import { PreviewMessage, ThinkingMessage } from './message'; import { useScrollToBottom } from './use-scroll-to-bottom'; -import { Overview } from './overview'; +import { Greeting } from './greeting'; import { memo } from 'react'; -import { Vote } from '@/lib/db/schema'; +import type { Vote } from '@/lib/db/schema'; import equal from 'fast-deep-equal'; -import { UseChatHelpers } from '@ai-sdk/react'; +import type { UseChatHelpers } from '@ai-sdk/react'; interface MessagesProps { chatId: string; @@ -35,7 +35,7 @@ function PureMessages({ ref={messagesContainerRef} className="flex flex-col min-w-0 gap-6 flex-1 overflow-y-scroll pt-4" > - {messages.length === 0 && } + {messages.length === 0 && } {messages.map((message, index) => ( { - return ( - -
-

- - + - -

-

- This is an{' '} - - open source - {' '} - chatbot template built with Next.js and the AI SDK by Vercel. It uses - the{' '} - streamText{' '} - function in the server and the{' '} - useChat hook - on the client to create a seamless chat experience. -

-

- You can learn more about the AI SDK by visiting the{' '} - - docs - - . -

-
-
- ); -};