index.tsx20 lines · main
1'use client'
2
3import Image from 'next/image'
4import { cn } from 'ui'
5import { CodeBlock } from 'ui-patterns/CodeBlock'
6
7const NextImageHandler = (props: any) => {
8 return (
9 <span className={cn('next-image--dynamic-fill', props.className)}>
10 <Image {...props} className={['rounded-md border'].join(' ')} layout="fill" />
11 </span>
12 )
13}
14
15export const markdownComponents = {
16 mono: (props: any) => <code className="text-sm">{props.children}</code>,
17 code: (props: any) => <CodeBlock {...props} />,
18 img: (props: any) => NextImageHandler(props),
19 Image: (props: any) => NextImageHandler(props),
20}