fix: clarify multi-document downloads
This commit is contained in:
@@ -19,7 +19,15 @@ import { FavoriteButton } from "../../../favorites/FavoriteButton";
|
||||
import { BubbleAttachmentDownloadButton } from "../BubbleAttachmentDownloadButton";
|
||||
import type { MessageBubbleVariant } from "../MessageBubble";
|
||||
|
||||
function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
|
||||
function AttachmentRow({
|
||||
postId,
|
||||
att,
|
||||
showDownload,
|
||||
}: {
|
||||
postId: string;
|
||||
att: Attachment;
|
||||
showDownload: boolean;
|
||||
}) {
|
||||
const { Icon, color } = fileIcon({ mime: att.mime, filename: att.filename });
|
||||
const displayFilename = filenameWithExtension(att.filename, att.mime);
|
||||
const [previewFailed, setPreviewFailed] = useState(false);
|
||||
@@ -70,7 +78,9 @@ function AttachmentRow({ postId, att }: { postId: string; att: Attachment }) {
|
||||
{formatBytes(att.sizeBytes)}
|
||||
</div>
|
||||
</div>
|
||||
<BubbleAttachmentDownloadButton postId={postId} attachment={att} />
|
||||
{showDownload ? (
|
||||
<BubbleAttachmentDownloadButton postId={postId} attachment={att} />
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -195,7 +205,12 @@ export function FileDocBubble({
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
{post.attachments.map((att) => (
|
||||
<AttachmentRow key={att.id} postId={post.id} att={att} />
|
||||
<AttachmentRow
|
||||
key={att.id}
|
||||
postId={post.id}
|
||||
att={att}
|
||||
showDownload={post.attachments.length >= 2}
|
||||
/>
|
||||
))}
|
||||
{text ? (
|
||||
<CollapsibleText className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[15px] font-medium leading-6 text-neutral-100">
|
||||
|
||||
Reference in New Issue
Block a user