import './src/styles/main.css';
import * as React from 'react';
import { MDXProvider } from '@mdx-js/react';
import {
ProblemComponent,
ProblemsListComponent,
} from './src/components/markdown/Problems';
const SpoilerComponent = ({ children, title }) => {
const [show, setShow] = React.useState(false);
return (
setShow(!show)}
style={{ marginBottom: 0 }}
>
{show && (
)}
{!show && (
)}
{title}
{show &&
{children}
}
);
};
const components = {
'module-excerpt': props => ,
spoiler: SpoilerComponent,
'info-block': ({
children,
title,
}: {
children: React.ReactNode;
title: string;
}) => (
),
'optional-content': ({
children,
title,
className,
}: {
children: React.ReactNode;
title?: string;
className?: string;
}) => (
Optional{title ? `: ${title}` : ''}
{children}
),
'problems-list': ProblemsListComponent,
problem: ProblemComponent,
table: props => ,
th: props => | ,
td: props => | ,
};
export const wrapRootElement = ({ element }) => (
{element}
);