Update examples and improve stability (#271)
This commit is contained in:
parent
25e4128e25
commit
70ed5c4f47
16 changed files with 118 additions and 101 deletions
|
|
@ -1,17 +1,37 @@
|
|||
import { Separator } from '@/components/ui/separator'
|
||||
import { UIState } from '@/lib/chat/actions'
|
||||
import { Session } from '@/lib/types'
|
||||
import Link from 'next/link'
|
||||
|
||||
export interface ChatList {
|
||||
messages: UIState
|
||||
session?: Session
|
||||
isShared: boolean
|
||||
}
|
||||
|
||||
export function ChatList({ messages }: ChatList) {
|
||||
export function ChatList({ messages, session, isShared }: ChatList) {
|
||||
if (!messages.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="relative mx-auto max-w-2xl px-4">
|
||||
{!isShared && !session ? (
|
||||
<div className="mb-8 rounded-lg border bg-white p-4 dark:bg-zinc-950">
|
||||
<p className="text-muted-foreground leading-normal">
|
||||
Please{' '}
|
||||
<Link href="/login" className="underline">
|
||||
log in
|
||||
</Link>{' '}
|
||||
or{' '}
|
||||
<Link href="/signup" className="underline">
|
||||
sign up
|
||||
</Link>{' '}
|
||||
to save and revisit your chat history!
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{messages.map((message, index) => (
|
||||
<div key={message.id}>
|
||||
{message.display}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue