import { getPostBySlug } from '@/lib/mdx'; import { MDXRemote } from 'next-mdx-remote/rsc'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { format } from 'date-fns'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; import { TableOfContents } from '@/components/mdx/TableOfContents'; import { SideNote } from '@/components/mdx/SideNote'; import { Citation, Bibliography } from '@/components/mdx/Citation'; import { MobileTableOfContents } from '@/components/mdx/MobileTableOfContents'; // Utility to ensure consistent IDs const slugify = (text: any): string => { if (!text) return ''; const str = typeof text === 'string' ? text : String(text); return str .toLowerCase() .replace(/[^a-z0-9]+/g, '-') .replace(/^-+|-+$/g, ''); }; const components = { h1: (props: any) =>

, h2: (props: any) =>

, h3: (props: any) =>

, p: (props: any) =>

, ul: (props: any) =>