'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 (
{cards.map(({ description, iconType = 'arrow', link, title }, index) => (

{title}

{iconType === 'arrow' && } {iconType === 'book' && }

{description}

))}
) } const components = { h1: ({ className, ...props }: React.HTMLAttributes) => (

), h2: ({ className, ...props }: React.HTMLAttributes) => (

), h3: ({ className, ...props }: React.HTMLAttributes) => (

), h4: ({ className, ...props }: React.HTMLAttributes) => (

), h5: ({ className, ...props }: React.HTMLAttributes) => (
), h6: ({ className, ...props }: React.HTMLAttributes) => (
), a: ({ className, ...props }: React.HTMLAttributes) => { if (props['aria-label'] === "Link to section") { return {props.children} } return }, p: ({ className, ...props }: React.HTMLAttributes) => (

), ul: ({ className, ...props }: React.HTMLAttributes) => (

    ), ol: ({ className, ...props }: React.HTMLAttributes) => (
      ), li: ({ className, ...props }: React.HTMLAttributes) => (
    1. ), blockquote: ({ className, ...props }: React.HTMLAttributes) => (
      *]:text-muted-foreground", className )} {...props} /> ), img: ({ className, alt, ...props }: React.ImgHTMLAttributes) => ( // eslint-disable-next-line @next/next/no-img-element {alt} ), 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 
                   toast.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}
              
      
              return 
          },
          Image,
          NextCardHolder
      }
      
      interface MdxProps {
          code: string
      }
      
      export function Mdx({ code }: MdxProps) {
          const Component = useMDXComponent(code)
      
          return (
              
      ) }