import clsx from 'clsx';
import Link from 'next/link';
type Text = {
type: 'text';
value: string;
bold?: boolean;
};
type Content =
| { type: 'paragraph'; children: Text[] }
| Text
| {
type: 'list';
listType: 'bullet' | 'ordered' | 'unordered';
children: Array<{ type: 'listItem'; children: Text[] }>;
}
| { type: 'listItem'; children: Text[] }
| { type: 'link'; children: Text[]; target: string; title: string; url: string };
const RichTextBlock = ({ block }: { block: Content }) => {
if (block.type === 'text') {
return block.bold ? (
{block.value}
) : (
{block.value}
);
}
if (block.type === 'link') {
return (
{block.children[0]?.value || block.title}
);
}
if (block.type === 'listItem') {
return block.children.map((child, index) =>
{block.children.map((child, index) => (