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, session, isShared }: ChatList) { if (!messages.length) { return null } return (
{!isShared && !session ? (

Please{' '} log in {' '} or{' '} sign up {' '} to save and revisit your chat history!

) : null} {messages.map((message, index) => (
{message.display} {index < messages.length - 1 && }
))}
) }