'use client' import { User, Bot, Loader2 } from 'lucide-react' import { cn } from '@/lib/utils' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { Avatar, AvatarFallback } from '@/components/ui/avatar' import { useLanguage } from '@/lib/i18n' interface ChatMessagesProps { messages: any[] isLoading?: boolean } function getMessageContent(msg: any): string { if (typeof msg.content === 'string') return msg.content if (msg.parts && Array.isArray(msg.parts)) { return msg.parts .filter((p: any) => p.type === 'text') .map((p: any) => p.text) .join('') } return '' } export function ChatMessages({ messages, isLoading }: ChatMessagesProps) { const { t } = useLanguage() return (
{t('chat.welcome')}