Skip to content

Instantly share code, notes, and snippets.

@brunosabot
Created February 27, 2022 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunosabot/4fc512dc3bdc5b3ac637f942c26c0466 to your computer and use it in GitHub Desktop.
Save brunosabot/4fc512dc3bdc5b3ac637f942c26c0466 to your computer and use it in GitHub Desktop.
const components = {
code: ({ className, children }: { className: string; children: any }) => {
if (className === undefined) return <code>{children}</code>;
return <Gist code={children} lang={className.replace("language-", "")} />;
},
Gist: Gist,
img: (props: { src: string; alt: string }) => (
// eslint-disable-next-line @next/next/no-img-element
<img {...props} src={props.src} alt={props.alt} loading="lazy" />
),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment