feat: Integrate forum layout support across various components and enhance room handling logic

This commit is contained in:
2026-07-06 01:06:20 +10:00
parent d1626e3585
commit c57797ffe4
62 changed files with 6876 additions and 385 deletions

View File

@@ -0,0 +1,27 @@
import React from 'react';
import { Text } from 'folds';
import * as theme from './forumTheme.css';
type ForumMessageBodyProps = {
body: string;
bodyHtml?: string;
};
export function ForumMessageBody({ body, bodyHtml }: ForumMessageBodyProps) {
const plain = body.trim();
if (bodyHtml) {
return (
<div
className={theme.ForumMessageBodyRich}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: bodyHtml }}
/>
);
}
if (!plain) return null;
return (
<Text as="p" className={theme.ForumMessageBody} size="T400">
{body}
</Text>
);
}