'use client' import { PropsWithChildren } from 'react' import { CH } from '@code-hike/mdx/components' import dynamic from 'next/dynamic' import { ArrowUpRight, Triangle } from 'lucide-react' import { Badge, cn, Collapsible_Shadcn_, CollapsibleContent_Shadcn_, CollapsibleTrigger_Shadcn_, Heading, Image, } from 'ui' import { Admonition } from 'ui-patterns/admonition' import type { ImageProps } from 'ui/src/components/Image/Image' const Avatar = dynamic(() => import('~/components/Avatar')) const Chart = dynamic(() => import('~/components/Charts/PGCharts')) const CodeBlock = dynamic(() => import('~/components/CodeBlock/CodeBlock')) const ImageFadeStack = dynamic(() => import('~/components/ImageFadeStack')) const ImageGrid = dynamic(() => import('~/components/ImageGrid')) const InlineCodeTag = dynamic(() => import('~/components/InlineCode')) const Quote = dynamic(() => import('~/components/Quote')) // import all components used in blog articles here // to do: move this into a helper/utils, it is used elsewhere const ignoreClass = 'ignore-on-export' const LinkComponent = (props: PropsWithChildren) => ( {props.children}{' '} {props.target === '_blank' && } ) const BlogCollapsible = ({ title, containerClassName, ...props }: { title: string containerClassName?: string }) => { return ( {title} ) } export default function mdxComponents(type?: 'blog' | 'lp' | undefined) { const components = { CodeBlock, CH, h1: (props: any) => , h2: (props: any) => , h3: (props: any) => , h4: (props: any) => , h5: (props: any) => , h6: (props: any) => , Badge, Quote, Avatar, PGChart: (props: any) => { return }, pre: (props: any) => { if (props.className !== ignoreClass) { return } else { return } }, ImageGrid, ImageFadeStack, img: (props: any) => { if (props.className !== ignoreClass) { return ( ) } return }, Img: ({ zoomable = true, className, ...props }: ImageProps & { wide?: boolean }) => ( ), Link: LinkComponent, code: (props: any) => {props.children}, BlogCollapsible: (props: any) => , Subtitle: (props: any) => (

), Admonition, } return components as any }