mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-28 05:50:37 +03:00
12 lines
254 B
TypeScript
12 lines
254 B
TypeScript
interface PrettyJsonProps {
|
|
data: unknown;
|
|
}
|
|
|
|
/**
|
|
* Displays JSON data in a formatted string.
|
|
*/
|
|
export function PrettyJson({ data }: PrettyJsonProps) {
|
|
const text = JSON.stringify(data, null, 2);
|
|
return <pre>{text === '{}' ? '' : text}</pre>;
|
|
}
|