diff --git a/src/components/messageStream/MessageBubble.tsx b/src/components/messageStream/MessageBubble.tsx index 66d4105..4df78e4 100644 --- a/src/components/messageStream/MessageBubble.tsx +++ b/src/components/messageStream/MessageBubble.tsx @@ -9,6 +9,7 @@ import { VideoBubble } from "./bubbles/VideoBubble"; import { LinkPreviewCard } from "./LinkPreviewCard"; import { formatDateTime } from "./utils/formatTime"; import { FavoriteButton } from "../../favorites/FavoriteButton"; +import { BubbleAttachmentDownloadButton } from "./BubbleAttachmentDownloadButton"; export type MessageBubbleVariant = "default" | "latest"; @@ -106,6 +107,12 @@ export function MessageBubble({ onFavoriteChange?.(post.id, favorited) } /> + {isFileBubble && post.attachments.length === 1 ? ( + + ) : null} ) : null} diff --git a/src/components/messageStream/bubbles/FileDocBubble.tsx b/src/components/messageStream/bubbles/FileDocBubble.tsx index bb97223..2d44503 100644 --- a/src/components/messageStream/bubbles/FileDocBubble.tsx +++ b/src/components/messageStream/bubbles/FileDocBubble.tsx @@ -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)} - + {showDownload ? ( + + ) : null} ); } @@ -195,7 +205,12 @@ export function FileDocBubble({ return (
{post.attachments.map((att) => ( - + = 2} + /> ))} {text ? (