2024-12-21 14:25:49 +01:00
|
|
|
import React from 'react'
|
|
|
|
import { Highlight } from '@freesewing/react/components/Highlight'
|
|
|
|
import hljs from 'highlight.js/lib/common'
|
|
|
|
|
|
|
|
export const Json = (props) => {
|
|
|
|
const code = props.js ? JSON.stringify(props.js, null, 2) : props.children
|
|
|
|
|
2024-12-22 16:32:46 +01:00
|
|
|
return (
|
|
|
|
<Highlight language="json" raw={hljs.highlight(code, { language: 'json' }).value} copy={code} />
|
|
|
|
)
|
2024-12-21 14:25:49 +01:00
|
|
|
}
|