2023-01-29 16:44:02 +01:00
|
|
|
import React from 'react'
|
2025-04-01 16:15:20 +02:00
|
|
|
import { Highlight } from '@freesewing/react/components/Highlight'
|
2023-01-29 16:44:02 +01:00
|
|
|
import hljs from 'highlight.js/lib/common'
|
|
|
|
|
|
|
|
export const Json = (props) => {
|
|
|
|
const code = props.js ? JSON.stringify(props.js, null, 2) : props.children
|
|
|
|
|
2025-04-01 16:15:20 +02:00
|
|
|
return (
|
|
|
|
<Highlight language="json" raw={hljs.highlight(code, { language: 'json' }).value} copy={code} />
|
|
|
|
)
|
2023-01-29 16:44:02 +01:00
|
|
|
}
|