Files
Arkie-Library-Frontend/src/components/messageStream/bubbles/ImageWithTextBubble.tsx
TerryM ad885f578c Merge origin/main into terry-media-adaptive-trial
Combine collapsible long-text (main) with adaptive image frame
(this branch). Resolved conflict in ImageWithTextBubble.tsx by
keeping both SingleImageFrame and CollapsibleText imports.
2026-05-30 00:17:10 +08:00

27 lines
929 B
TypeScript

import { useI18n } from "../../../i18n";
import type { Post } from "../../../types/post";
import { autolink } from "../utils/autolink";
import { postDisplayText } from "../utils/postText";
import { CollapsibleText } from "../CollapsibleText";
import { SingleImageFrame } from "./SingleImageFrame";
export function ImageWithTextBubble({ post }: { post: Post }) {
const { lang } = useI18n();
const att = post.attachments[0];
const text = postDisplayText(post, lang);
if (!att) return null;
return (
<div className="flex flex-col">
<SingleImageFrame postId={post.id} attachment={att} text={text} />
{text ? (
<CollapsibleText
wrapperClassName="px-4 pt-3"
className="message-stream-copyable-text select-text whitespace-pre-wrap break-words text-[14px] leading-6 text-neutral-100"
>
{autolink(text)}
</CollapsibleText>
) : null}
</div>
);
}