UNPKG

@alauda/doom

Version:

Doctor Doom making docs.

8 lines (7 loc) 515 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { CodeBlockRuntime, Tab, Tabs } from '@rspress/core/theme-original'; import { stringify } from 'yaml'; export const JsonViewer = ({ value }) => { return (_jsxs(Tabs, { children: [_jsx(Tab, { label: "yaml", children: _jsx(CodeBlockRuntime, { lang: "yaml", code: stringify(value) }) }), _jsx(Tab, { label: "json", children: _jsx(CodeBlockRuntime, { lang: "json", code: JSON.stringify(value, null, 2) }) })] })); }; export default JsonViewer;