import { useI18n } from "../../../i18n"; import type { Post } from "../../../types/post"; import { useLightbox } from "../overlays/ImageLightbox"; import { autolink } from "../utils/autolink"; import { postDisplayText } from "../utils/postText"; export function ImageWithTextBubble({ post }: { post: Post }) { const { openLightbox } = useLightbox(); const { lang } = useI18n(); const att = post.attachments[0]; const text = postDisplayText(post, lang); if (!att) return null; const ratio = att.width && att.height ? `${att.width} / ${att.height}` : "4 / 3"; return (
{text ? (
{autolink(text)}
) : null}
); }