import type { MDXComponents } from 'mdx/types' import Link from 'next/link' import { ClickableHeading } from '@/app/components/docs/ClickableHeading' import { DocsPageMenu } from '@/app/components/docs/DocsPageMenu' export function useMDXComponents(components: MDXComponents): MDXComponents { return { h1: ({ children }) => (
{children}
), a: ({ href, children }) => { const isInternal = href && (href.startsWith('/') || href.startsWith('#')) const className = "text-base-content underline underline-offset-2 hover:text-muted transition-colors" if (isInternal) { return ( {children} ) } return ( {children} ) }, strong: ({ children }) => ( {children} ), code: ({ children }) => (
{children}
),
pre: ({ children }) => (
{children}
),
ul: ({ children }) => (
{children}), hr: () =>