mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 20:40:21 +02:00
update JsonPreview to use Code component
This commit is contained in:
@@ -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