import * as React from "react"; import Link from "next/link"; import { useMDXComponent } from "next-contentlayer2/hooks"; import { cn } from "@/lib/utils"; import { MdxCard } from "@/components/content/mdx-card"; import BlurImage from "@/components/shared/blur-image"; import { Callout } from "@/components/shared/callout"; import { CopyButton } from "@/components/shared/copy-button"; import { DocsLang } from "../shared/docs-lang"; import { Separator } from "../ui/separator"; const components = { h1: ({ className, ...props }) => (
), h2: ({ className, ...props }) => ( ), h3: ({ className, ...props }) => ( ), h4: ({ className, ...props }) => ( ), h5: ({ className, ...props }) => ( ), h6: ({ className, ...props }) => ( ), a: ({ className, ...props }) => ( ), p: ({ className, ...props }) => ( ), ul: ({ className, ...props }) => (*]:text-muted-foreground", className, )} {...props} /> ), img: ({ className, alt, ...props }: React.ImgHTMLAttributes) => ( // eslint-disable-next-line @next/next/no-img-element ), hr: ({ ...props }) =>
, table: ({ className, ...props }: React.HTMLAttributes) => ( ), tr: ({ className, ...props }: React.HTMLAttributes
) => ( ), th: ({ className, ...props }) => ( ), td: ({ className, ...props }) => ( ), pre: ({ className, __rawString__, ...props }: React.HTMLAttributes & { __rawString__?: string }) => ( {__rawString__ && (), code: ({ className, ...props }) => ()} ), Callout, Card: MdxCard, DocsLang, Step: ({ className, ...props }: React.ComponentProps<"h3">) => ( ), Steps: ({ ...props }) => ( ), Link: ({ className, ...props }: React.ComponentProps) => ( ), LinkedCard: ({ className, ...props }: React.ComponentProps ) => ( ), }; interface MdxProps { code: string; images?: { alt: string; src: string; blurDataURL: string }[]; } export function Mdx({ code, images }: MdxProps) { const Component = useMDXComponent(code); const MDXImage = (props: any) => { if (!images) return null; const blurDataURL = images.find( (image) => image.src === props.src, )?.blurDataURL; return ( ); }; return ( ); }