[examples/openspending] - openspending v0.2
This commit is contained in:
17
examples/openspending/components/MDXPage.tsx
Normal file
17
examples/openspending/components/MDXPage.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { MDXRemote } from 'next-mdx-remote';
|
||||
import layouts from '../layouts';
|
||||
|
||||
export default function MDXPage({ source, frontMatter }) {
|
||||
const Layout = ({ children }) => {
|
||||
const layoutName = frontMatter?.layout || 'default';
|
||||
const LayoutComponent = layouts[layoutName];
|
||||
|
||||
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
|
||||
};
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<MDXRemote {...source} components={[]} />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user