import type { ReactNode } from 'react'; import type { OrderMessage } from '@/app/lib/order-messages'; import { OrderMessageTime } from './OrderMessageTime'; export function OrderConversation({ messages, studioView = false, onUseNote, children }: { messages: OrderMessage[]; studioView?: boolean; onUseNote?: (note: string) => void; children?: ReactNode; }) { if (messages.length === 0 && !children) return null; return (

Order conversation

{messages.length > 0 &&
    {messages.map(({ author, note, at, kind }, index) => (
  1. {author === 'studio' ? 'Lumen & Gesso' : studioView ? 'Customer' : 'You'} {kind === 'revision' && ' · Revision request'} {kind === 'question' && ' · Question on proof'} {kind === 'proof' && ' · Proof sent'} {' · '}

    {note}

    {author === 'customer' && onUseNote && ( )}
  2. ))}
} {children}
); }