Files
anouma/components/RichText.tsx
T
maro 45261a0461 Initial commit: ANOUMA website with Payload CMS, WebRTC meetings, and booking system
- Next.js 16 App Router site with the ANOUMA design system
- Payload CMS (PostgreSQL) for offers, events, posts and page content
- WebRTC video-call system with custom signaling server
- SMTP email reminders and booking-request notifications
- Customer accounts, calendar-based availability, and booking workflow
2026-08-25 16:40:51 +02:00

32 lines
1.1 KiB
TypeScript

import {
RichText as LexicalRichText,
type JSXConvertersFunction,
} from "@payloadcms/richtext-lexical/react";
import type { DefaultNodeTypes } from "@payloadcms/richtext-lexical";
const converters: JSXConvertersFunction<DefaultNodeTypes> = ({ defaultConverters }) => ({
...defaultConverters,
paragraph: ({ node, nodesToJSX }) => {
const children = nodesToJSX({ nodes: node.children });
if (!children?.length) return null;
return <p className="text-lg leading-relaxed text-anouma-plum">{children}</p>;
},
heading: ({ node, nodesToJSX }) => {
const children = nodesToJSX({ nodes: node.children });
const Tag = node.tag;
return (
<Tag className="mt-4 font-serif text-3xl font-medium text-anouma-plum">{children}</Tag>
);
},
});
type RichTextProps = {
data: NonNullable<Parameters<typeof LexicalRichText>[0]["data"]>;
className?: string;
};
/** Renders a Payload Lexical richText field with the ANOUMA reading styles. */
export function RichText({ data, className = "space-y-6" }: RichTextProps) {
return <LexicalRichText data={data} converters={converters} className={className} />;
}