import type { RoomThreadEntry } from './roomThread'; type RoomAttachment = NonNullable[number]; function attachmentDisplayName(attachment: RoomAttachment): string { if (attachment.name) return attachment.name; const segments = attachment.path.split(/[\\/]/); return segments.at(-1) || 'attachment'; } function attachmentUrl(attachment: RoomAttachment): string { return `/api/attachments?path=${encodeURIComponent(attachment.path)}`; } export function RoomAttachmentGallery({ attachments, }: { attachments?: RoomThreadEntry['attachments']; }) { if (!attachments || attachments.length === 0) return null; return ( ); }