import { nodeTypes } from "@mdx-js/mdx" import rehypeShiki from "@shikijs/rehype" import { MDXRemote } from "next-mdx-remote/rsc" import Image from "next/image" import { FaLink } from "react-icons/fa" import rehypeKatex from "rehype-katex" import rehypeRaw from "rehype-raw" import rehypeSlug from "rehype-slug" import remarkGfm from "remark-gfm" import remarkMath from "remark-math" import { Link } from "@repo/i18n/routing" import "katex/dist/katex.min.css" import { BlogPostComments } from "./BlogPostComments.tsx" const Heading: React.FC< React.DetailedHTMLProps< React.HTMLAttributes, HTMLHeadingElement > & { as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" } > = (props) => { const { children, as, id = "", ...rest } = props const ComponentAs = as return ( {children} ) } export interface BlogPostContentProps { content: string } export const BlogPostContent: React.FC = async ( props, ) => { const { content } = props return (
{ return }, h2: (props) => { return }, h3: (props) => { return }, h4: (props) => { return }, h5: (props) => { return }, h6: (props) => { return }, img: (properties) => { const { src = "", alt = "Blog Image" } = properties const source = src.replace("../../../apps/website/public/", "/") return ( {alt} ) }, a: (props) => { const { href = "", ...rest } = props const hrefString = href as string if (hrefString.startsWith("#")) { return } if (hrefString.startsWith("../posts/")) { return ( ) } return }, }} />
) }