update JsonPreview to use Code component

This commit is contained in:
jeffvli
2025-11-29 13:30:23 -08:00
parent f448572e0a
commit abd2f9485c
2 changed files with 4 additions and 4 deletions
@@ -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>
);
};