-
Notifications
You must be signed in to change notification settings - Fork 207
/
Copy pathdefaultLabelsRenderer.js
31 lines (29 loc) · 1.09 KB
/
defaultLabelsRenderer.js
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
import { igniteComponents } from "next-ignite";
// eslint-disable-next-line import/no-extraneous-dependencies
import { defaultLabels } from "@auto-it/core/dist/semver";
import Highlight, { defaultProps } from "prism-react-renderer";
/** Render the current default labels in a details element */
export const DefaultLabelRenderer = () => (
<details>
<summary>Click here to see the default label configuration</summary>
<Highlight
Prism={defaultProps.Prism}
code={JSON.stringify(defaultLabels, null, 2)}
language="json"
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<igniteComponents.pre className={className} style={style}>
<igniteComponents.code className="language-json">
{tokens.map((line, i) => (
<div {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span {...getTokenProps({ token, key })} />
))}
</div>
))}
</igniteComponents.code>
</igniteComponents.pre>
)}
</Highlight>
</details>
);