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