Files
Arkie-Library-Frontend/src/components/messageStream/bubbles/ImageWithTextBubble.tsx

27 lines
929 B
TypeScript
Raw Normal View History

2026-05-26 12:07:13 +08:00
import { useI18n } from "../../../i18n";
import type { Post } from "../../../types/post";
import { autolink } from "../utils/autolink";
2026-05-26 12:07:13 +08:00
import { postDisplayText } from "../utils/postText";
import { CollapsibleText } from "../CollapsibleText";
import { SingleImageFrame } from "./SingleImageFrame";
export function ImageWithTextBubble({ post }: { post: Post }) {
2026-05-27 12:33:26 +08:00
const { lang } = useI18n();
const att = post.attachments[0];
2026-05-26 12:07:13 +08:00
const text = postDisplayText(post, lang);
if (!att) return null;
return (
<div className="flex flex-col">
<SingleImageFrame postId={post.id} attachment={att} text={text} />
2026-05-26 12:07:13 +08:00
{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>
);
}