'use client' import { cn } from "@/lib/utils" import { useMDXComponent } from "next-contentlayer/hooks" import Image from "next/image" import Link from "next/link" import * as React from "react" import toast from "react-hot-toast" import { BsLink45Deg } from 'react-icons/bs' import { FiBookOpen, FiCopy } from "react-icons/fi" import { IoArrowForwardOutline } from 'react-icons/io5' interface NextCardHolderProps { cards: { title: string description: string link: string iconType?: 'arrow' | 'book' }[] } function NextCardHolder({ cards }: NextCardHolderProps) { return (
{description}
))}*]: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 }: React.HTMLAttributes ) => ( ), td: ({ className, ...props }: React.HTMLAttributes ) => ( ), pre: ({ className, ...props }: React.HTMLAttributes ) => { // @ts-ignore if (props['data-language'] === 'command') return return }, code: ({ className, ...props }: React.HTMLAttributes ) => { // @ts-ignore if (props['data-language'] === 'command') return returntoast.success('copied! 📝')} className="absolute top-1/2 -translate-y-1/2 right-1 hover:bg-indigo-200 p-2 rounded-md box-content transition-all cursor-pointer" /> {props.children} }, Image, NextCardHolder } interface MdxProps { code: string } export function Mdx({ code }: MdxProps) { const Component = useMDXComponent(code) return () }