Skip to content

Commit ccbc649

Browse files
feat: update chat greeting (vercel#905)
1 parent be774ea commit ccbc649

File tree

5 files changed

+37
-60
lines changed

5 files changed

+37
-60
lines changed

components/chat-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { PlusIcon, VercelIcon } from './icons';
1111
import { useSidebar } from './ui/sidebar';
1212
import { memo } from 'react';
1313
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
14-
import { VisibilityType, VisibilitySelector } from './visibility-selector';
14+
import { type VisibilityType, VisibilitySelector } from './visibility-selector';
1515

1616
function PureChatHeader({
1717
chatId,

components/greeting.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { motion } from 'framer-motion';
2+
3+
export const Greeting = () => {
4+
return (
5+
<div
6+
key="overview"
7+
className="max-w-3xl mx-auto md:mt-20 px-8 size-full flex flex-col justify-center"
8+
>
9+
<motion.div
10+
initial={{ opacity: 0, y: 10 }}
11+
animate={{ opacity: 1, y: 0 }}
12+
exit={{ opacity: 0, y: 10 }}
13+
transition={{ delay: 0.5 }}
14+
className="text-2xl font-semibold"
15+
>
16+
Hello there!
17+
</motion.div>
18+
<motion.div
19+
initial={{ opacity: 0, y: 10 }}
20+
animate={{ opacity: 1, y: 0 }}
21+
exit={{ opacity: 0, y: 10 }}
22+
transition={{ delay: 0.6 }}
23+
className="text-2xl text-zinc-500"
24+
>
25+
How can I help you today?
26+
</motion.div>
27+
</div>
28+
);
29+
};

components/messages.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { UIMessage } from 'ai';
1+
import type { UIMessage } from 'ai';
22
import { PreviewMessage, ThinkingMessage } from './message';
33
import { useScrollToBottom } from './use-scroll-to-bottom';
4-
import { Overview } from './overview';
4+
import { Greeting } from './greeting';
55
import { memo } from 'react';
6-
import { Vote } from '@/lib/db/schema';
6+
import type { Vote } from '@/lib/db/schema';
77
import equal from 'fast-deep-equal';
8-
import { UseChatHelpers } from '@ai-sdk/react';
8+
import type { UseChatHelpers } from '@ai-sdk/react';
99

1010
interface MessagesProps {
1111
chatId: string;
@@ -35,7 +35,7 @@ function PureMessages({
3535
ref={messagesContainerRef}
3636
className="flex flex-col min-w-0 gap-6 flex-1 overflow-y-scroll pt-4"
3737
>
38-
{messages.length === 0 && <Overview />}
38+
{messages.length === 0 && <Greeting />}
3939

4040
{messages.map((message, index) => (
4141
<PreviewMessage

components/multimodal-input.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import type { Attachment, Message, UIMessage } from 'ai';
3+
import type { Attachment, UIMessage } from 'ai';
44
import cx from 'classnames';
55
import type React from 'react';
66
import {
@@ -22,7 +22,7 @@ import { Button } from './ui/button';
2222
import { Textarea } from './ui/textarea';
2323
import { SuggestedActions } from './suggested-actions';
2424
import equal from 'fast-deep-equal';
25-
import { UseChatHelpers } from '@ai-sdk/react';
25+
import type { UseChatHelpers } from '@ai-sdk/react';
2626

2727
function PureMultimodalInput({
2828
chatId,

components/overview.tsx

-52
This file was deleted.

0 commit comments

Comments
 (0)