import type { MDXComponents } from 'mdx/types'; import NextImage from 'next/image'; import type { AnchorHTMLAttributes, ImgHTMLAttributes, ReactNode } from 'react'; import { ButtonLink, Figure, Heading, Icon, Link, List, ListItem, } from './atoms'; import { Code, Grid, GridItem } from './molecules'; import { PageSection } from './templates'; const Anchor = ({ children = '', href = '', hrefLang, rel, ...props }: AnchorHTMLAttributes) => ( {children} ); const Img = ({ alt, src, height, placeholder, width, ...props }: ImgHTMLAttributes) => { if (src) return ( ); // eslint-disable-next-line @next/next/no-img-element return {alt}; }; const Gallery = ({ children }: { children: ReactNode }) => ( {children} ); export const mdxComponents: MDXComponents = { a: Anchor, ButtonLink, Code, figure: ({ ref, ...props }) =>
, Figure, Gallery, Grid, GridItem, h1: ({ ref, ...props }) => , h2: ({ ref, ...props }) => , h3: ({ ref, ...props }) => , h4: ({ ref, ...props }) => , h5: ({ ref, ...props }) => , h6: ({ ref, ...props }) => , Icon, img: Img, Img, li: ({ ref, ...props }) => , Link, List, ListItem, PageSection, ol: ({ ref, ...props }) => ( ), ul: ({ ref, ...props }) => ( ), };