import { cn } from "@/lib/utils" import type { ChatAttachment } from "@/store/chat" interface UserMessageProps { content: string attachments?: ChatAttachment[] } export function UserMessage({ content, attachments = [] }: UserMessageProps) { const hasText = content.trim().length > 0 const isCommand = content.trim().startsWith("/") const imageAttachments = attachments.filter( (attachment) => attachment.type === "image", ) return (
{imageAttachments.length > 0 && (
{imageAttachments.map((attachment, index) => ( {attachment.filename ))}
)} {hasText && (
{isCommand ? (
{content}
) : ( content )}
)}
) }