import { useI18n } from "../../../i18n"; import type { Attachment, Post } from "../../../types/post"; import { useLightbox } from "../overlays/ImageLightbox"; import { autolink } from "../utils/autolink"; import { postDisplayText } from "../utils/postText"; const MAX_VISIBLE = 4; function imageRatio(att: Attachment) { return att.width && att.height ? `${att.width} / ${att.height}` : "4 / 3"; } export function AlbumBubble({ post }: { post: Post }) { const { openLightbox } = useLightbox(); const { lang } = useI18n(); const images = post.attachments; const text = postDisplayText(post, lang); const shouldMerge = images.length > MAX_VISIBLE; if (!shouldMerge) { return (