import clsx from 'clsx'
import type { MDXRemoteProps } from 'next-mdx-remote/rsc'
import { CodeBlock } from '@/lib/content/code'
import { ContentImage } from '@/app/(landing)/components/content-image'
export const mdxComponents: MDXRemoteProps['components'] = {
img: (props: any) => (
),
h2: ({ children, className, ...props }: any) => (
{children}
),
h3: ({ children, className, ...props }: any) => (
{children}
),
h4: ({ children, className, ...props }: any) => (
{children}
),
p: (props: any) => (
),
ul: (props: any) => (
),
ol: (props: any) => (
),
li: (props: any) => ,
strong: (props: any) => (
),
em: (props: any) => (
),
a: (props: any) => {
const isAnchorLink = props.className?.includes('anchor')
if (isAnchorLink) {
return
}
return (
)
},
figure: (props: any) => (
),
hr: (props: any) => (
),
pre: (props: any) => {
const child = props.children
const isCodeBlock = child && typeof child === 'object' && child.props
if (isCodeBlock) {
const codeContent = child.props.children || ''
const className = child.props.className || ''
const language = className.replace('language-', '') || 'javascript'
const languageMap: Record = {
js: 'javascript',
jsx: 'javascript',
ts: 'javascript',
tsx: 'javascript',
typescript: 'javascript',
javascript: 'javascript',
json: 'json',
python: 'python',
py: 'python',
}
const mappedLanguage = languageMap[language.toLowerCase()] || 'javascript'
return (
)
}
return
},
code: (props: any) => {
if (!props.className) {
return (
)
}
return
},
}