chore: show compact attachment count instead of thumbnails in comment previews

When truncate mode is active (comment list), display an inline file icon
with attachment count instead of rendering full image thumbnails.
This commit is contained in:
memoclaw 2026-03-24 19:30:39 +08:00
parent 6a03917f6e
commit 4f6730a12e
1 changed files with 10 additions and 2 deletions

View File

@ -132,9 +132,17 @@ const MemoPreview = ({
)}
>
{showMeta && meta}
{showMeta && truncate && hasContent && <div className="text-muted-foreground/50 shrink-0">·</div>}
{showMeta && truncate && (hasContent || hasAttachments) && <div className="text-muted-foreground/50 shrink-0">·</div>}
{contentNode}
{hasAttachments && <AttachmentThumbnails attachments={attachments} />}
{hasAttachments &&
(truncate ? (
<div className="shrink-0 text-muted-foreground/70 inline-flex justify-center items-center gap-0.5">
<FileIcon className="w-3 h-3 inline-block" />
<span className="text-xs">{attachments.length}</span>
</div>
) : (
<AttachmentThumbnails attachments={attachments} />
))}
</div>
</MemoViewContext.Provider>
);