AttachmentsPreview
Shared attachment display components for chat prompts and messages.
Overview
Attachments renders file and source-document references without owning upload, persistence, or message state. Use it anywhere chat UI needs a consistent attachment preview.
Usage
import {
Attachment,
AttachmentInfo,
AttachmentPreview,
AttachmentRemove,
Attachments,
} from "@tilt-legal/cubitt-components/chat-elements";Examples
Default
<Attachments>
{files.map((file) => (
<Attachment data={file} key={file.id} onRemove={() => remove(file.id)}>
<AttachmentPreview />
<AttachmentRemove />
</Attachment>
))}
</Attachments>Inline
<Attachments variant="inline">
{files.map((file) => (
<Attachment data={file} key={file.id} onRemove={() => remove(file.id)}>
<AttachmentPreview />
<AttachmentInfo />
<AttachmentRemove />
</Attachment>
))}
</Attachments>List
<Attachments variant="list">
{files.map((file) => (
<Attachment data={file} key={file.id} onRemove={() => remove(file.id)}>
<AttachmentPreview />
<AttachmentInfo showMediaType />
<AttachmentRemove />
</Attachment>
))}
</Attachments>