import { Sparkles, User, ListChecks } from 'lucide-react' import { MarkdownContent } from '@/components/ui/MarkdownContent' import { SuggestedFlowCard } from './SuggestedFlowCard' import type { SuggestedFlow } from '@/types/copilot' interface ChatMessageProps { role: 'user' | 'assistant' content: string suggestedFlows?: SuggestedFlow[] imageUrls?: string[] /** When set on an assistant message, renders a leading "Next steps · N pending" * emphasis above the bubble. Used on the current turn only — the canonical * list of items lives in the TaskLane. */ actionCount?: number } export function ChatMessage({ role, content, suggestedFlows, imageUrls, actionCount }: ChatMessageProps) { const hasActionEmphasis = role === 'assistant' && actionCount !== undefined && actionCount > 0 return (
{/* Avatar */}
{role === 'assistant' ? : }
{/* Content */}
{/* Image attachments (user messages only) */} {role === 'user' && imageUrls && imageUrls.length > 0 && (
{imageUrls.map((url, i) => ( {`Attachment ))}
)} {hasActionEmphasis && (
Next steps · {actionCount} pending in Tasks
)}
{/* Suggested flows (assistant only) */} {role === 'assistant' && suggestedFlows && suggestedFlows.length > 0 && (
Related Flows {suggestedFlows.map(flow => ( ))}
)}
) }