'use client'; import { Separator } from '@/components/ui/Separator'; import { ChatMessage } from '@/components/chat/ChatMessage'; import { MessageBase } from '../../lib/types'; import { Session } from 'next-auth'; import { IconExclamationTriangle } from '../ui/Icons'; import Link from 'next/link'; export interface ChatList { messages: MessageBase[]; session: Session | null; } export function ChatList({ messages, session }: ChatList) { return (
{!session && ( <>

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

)} {messages // .filter(message => message.role !== 'system') .map((message, index) => (
{index < messages.length - 1 && ( )}
))}
); }