'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; isLoading: boolean; } export function ChatList({ messages, session, isLoading }: ChatList) { return (
{!session && ( <>
{process.env.NEXT_PUBLIC_IS_HUGGING_FACE ? (

Please visit and login into{' '} our landing website {' '} to save and revisit your chat history!

) : (

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

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