mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 13:40:24 +02:00
update JsonPreview to use Code component
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
.preview {
|
.preview {
|
||||||
padding: var(--theme-spacing-md);
|
|
||||||
font-family: var(--theme-content-font-family);
|
|
||||||
font-size: var(--theme-font-size-md);
|
font-size: var(--theme-font-size-md);
|
||||||
background: var(--theme-colors-surface);
|
background: var(--theme-colors-surface);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
import styles from './json-preview.module.css';
|
import styles from './json-preview.module.css';
|
||||||
|
|
||||||
|
import { Code } from '/@/shared/components/code/code';
|
||||||
|
|
||||||
interface JsonPreviewProps {
|
interface JsonPreviewProps {
|
||||||
value: Record<string, any> | string;
|
value: Record<string, any> | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const JsonPreview = ({ value }: JsonPreviewProps) => {
|
export const JsonPreview = ({ value }: JsonPreviewProps) => {
|
||||||
return (
|
return (
|
||||||
<pre className={styles.preview} style={{ userSelect: 'all' }}>
|
<Code block className={styles.preview} lang="json" p="md">
|
||||||
{JSON.stringify(value, null, 4)}
|
{JSON.stringify(value, null, 4)}
|
||||||
</pre>
|
</Code>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user