forked from duneanalytics/evm.codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocRow.tsx
More file actions
67 lines (60 loc) · 1.59 KB
/
DocRow.tsx
File metadata and controls
67 lines (60 loc) · 1.59 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { MDXRemote } from 'next-mdx-remote'
import { IOpcodeDoc } from 'types'
import { GITHUB_REPO_URL } from 'util/constants'
import * as Doc from 'components/ui/Doc'
type Props = {
opcode: IOpcodeDoc
}
const docComponents = {
h1: Doc.H1,
h2: Doc.H2,
h3: Doc.H3,
p: Doc.P,
ul: Doc.UL,
ol: Doc.OL,
li: Doc.LI,
table: Doc.Table,
th: Doc.TH,
td: Doc.TD,
a: Doc.A,
}
const DocRow = ({ opcode }: Props) => {
return (
<div className="text-sm px-4 md:px-8 py-8 bg-indigo-50 dark:bg-black-600">
{opcode && (
<>
<table className="table-auto mb-6 bg-indigo-100 dark:bg-black-500 rounded font-medium">
<thead>
<tr className="text-gray-500 uppercase text-xs">
<td className="pt-2 px-4">Since</td>
<td className="pt-2 px-4">Group</td>
</tr>
</thead>
<tbody>
<tr>
<td className="pb-2 px-4">{opcode.meta.fork}</td>
<td className="pb-2 px-4">{opcode.meta.group}</td>
</tr>
</tbody>
</table>
<MDXRemote {...opcode.mdxSource} components={docComponents} />
</>
)}
{!opcode && (
<div>
There is no reference doc for this opcode yet. Why not{' '}
<a
className="underline font-medium"
href={`${GITHUB_REPO_URL}/new/main/docs/opcodes`}
target="_blank"
rel="noreferrer"
>
contribute?
</a>{' '}
;)
</div>
)}
</div>
)
}
export default DocRow