import { Annotation, annotations, Code, CodeSlot, InlineCode, Preview, PreviewSlot, Scrollycoding, Section, SectionCode, SectionLink, Slideshow, Spotlight, } from '@code-hike/mdx/components' import Avatar from '~/components/Avatar' import BlogCollapsible from '~/components/Blog/BlogCollapsible' import DeveloperGrowthChart from '~/components/Charts/DeveloperGrowthChart' import Chart from '~/components/Charts/PGCharts' import CodeBlock from '~/components/CodeBlock/CodeBlock' import ImageFadeStack from '~/components/ImageFadeStack' import ImageGrid from '~/components/ImageGrid' import InlineCodeTag from '~/components/InlineCode' import Quote from '~/components/Quote' import Tabs, { TabPanel } from '~/components/Tabs/Tabs' import { ArrowUpRight } from 'lucide-react' import type { PropsWithChildren } from 'react' import { Badge, cn, Heading } from 'ui' import { Admonition } from 'ui-patterns/Admonition' import { Image, type ImageProps } from 'ui-patterns/Image' import { Mermaid } from 'ui-patterns/Mermaid' const CH = { Annotation, Code, CodeSlot, InlineCode, Preview, PreviewSlot, Scrollycoding, Section, SectionCode, SectionLink, Slideshow, Spotlight, annotations, } // 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' && } ) export default function mdxComponents(type?: 'blog' | 'lp' | undefined) { const components = { CodeBlock, Tabs, TabPanel, 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 }, DeveloperGrowthChart, pre: (props: any) => { if (props.className !== ignoreClass) { const childProps = props.children?.props // Detect mermaid code blocks and render with Mermaid component if (childProps?.className === 'language-mermaid') { return } return } else { return } }, ImageGrid, ImageFadeStack, img: (props: any) => { if (props.className !== ignoreClass) { return ( ) } // biome-ignore lint/a11y/useAltText: provided in props return }, Img: ({ zoomable = true, className, ...props }: ImageProps & { wide?: boolean }) => ( ), Link: LinkComponent, code: (props: any) => {props.children}, BlogCollapsible: (props: any) => , Subtitle: (props: any) => (

), Admonition, Mermaid, } return components as any }