import Link from "next/link"; import Image from "next/image"; import TweetEmbed from "react-tweet-embed"; import Gist from "react-gist"; import getNodeText from "../lib/getNodeText"; import Video from "./video/FullPageVideo"; import CopyButton from "./clipboard/CopyButton"; import { MarkGithubIcon } from "@primer/octicons-react"; import type { LinkProps } from "next/link"; import type { ImageProps } from "next/image"; import type { ReactPlayerProps } from "react-player"; // The following components are all passed into as replacement HTML tags or drop-in React components // available in .mdx files containing post content, since they're not directly aware of the components in this folder. const mdxComponents = { a: ({ href, target, rel, className, children, }: LinkProps & { target?: string; rel?: string; className?: string; children?: unknown; }) => ( {children} ), img: (props: ImageProps) => { return ( // height and width are part of the props, so they get automatically passed here with {...props}
{/* eslint-disable-next-line jsx-a11y/alt-text */}
); }, code: (props: any) => { if (props.className?.split(" ").includes("hljs")) { return (
{props.children}
); } else { return {props.children}; } }, video: (props: ReactPlayerProps) =>