diff --git a/src/components/mdx/CodeBlock.tsx b/src/components/mdx/CodeBlock.tsx index b5a0692..bc482f9 100644 --- a/src/components/mdx/CodeBlock.tsx +++ b/src/components/mdx/CodeBlock.tsx @@ -1,14 +1,14 @@ -import { Highlight, themes } from "prism-react-renderer"; +import {Highlight, themes} from "prism-react-renderer"; import styled from "styled-components"; -import { ReactElement } from "react"; -export default function CodeBlock(props: { children: ReactElement }) { - const className = props.children.props.className || ""; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export default function CodeBlock(props: any) { + const className = props.children?.props.className || ""; const matches = className.match(/language-(?.*)/); return ( = { +const defaultTheme = { fontSizes: { tiny: "12px", s: "14px", @@ -90,12 +90,12 @@ const defaultTheme: Omit = { code: 1.6, }, media: { - mobile: (...args) => css` + mobile: (...args: RuleSet) => css` @media only screen and (max-width: 800px) { ${args} } `, - desktop: (...args) => css` + desktop: (...args: RuleSet) => css` @media only screen and (min-width: 800px) { ${args} }