"use client"; import React from "react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import remarkToc from "remark-toc"; import rehypeSlug from "rehype-slug"; import rehypeHighlight from "rehype-highlight"; import "highlight.js/styles/github.css"; interface MarkdownRendererProps { children: string; /** Project markdown files open with `# Title`; shift those headings down. Blog posts already have a page `

`. */ shiftHeadings?: boolean; } export default function MarkdownRenderer({ children, shiftHeadings = true, }: MarkdownRendererProps) { return ( (

{content}

), h2: ({ children: content, ...props }: { children?: React.ReactNode }) => (

{content}

), h3: ({ children: content, ...props }: { children?: React.ReactNode }) => (

{content}

), } : {}), img: (props) => ( // eslint-disable-next-line @next/next/no-img-element {props.alt ), }} > {children}
); }