-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
29 lines (25 loc) · 970 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import DataTable from "react-data-table-component";
import ReactMarkdown, { Components } from "react-markdown";
import fs from "fs";
import Link from "next/link";
export function getStaticProps() {
return { props: { readme: fs.readFileSync("README.md").toString() } }
}
const components: Components = {
a: ({ href, children }) =>
<Link href={href || "#"} target={href?.startsWith("http") ? "_blank" : "_self"}>
{children}
</Link>
}
const Index = ({ readme }: { readme: string }) =>
<div className={"markdown-body"}>
<ReactMarkdown components={components}>{readme}</ReactMarkdown>
<DataTable
columns={[ { name: "Str" }, { name: "Num" } ]}
data={[ { Str: "A", Num: 1 } ]}
// This line causes a hydration error in the pagination footer "nav" element (iff the
// browser window is ≥599px wide); commenting this line fixes it.
pagination
/>
</div>
export default Index