import r from"react";import l from"styled-components";import{JsonViewer as n}from"@redocly/theme/components/JsonViewer/JsonViewer";import{ClipboardService as a}from"@redocly/theme/core/utils";function E(c){const{json:e,title:t,errors:o}=c;return o.length?r.createElement(i,null,r.createElement(p,null,"error"),r.createElement(n,{data:o,expandLevel:3,onCopyClick:()=>{a.copyCustom(JSON.stringify(o))},title:t})):r.createElement(n,{data:e,expandLevel:3,onCopyClick:()=>{a.copyCustom(JSON.stringify(e))},title:t})}const i=l.div`
  background-color: var(--code-block-bg-color);
  border: 2px solid var(--color-error-border);
`,p=l.p`
  color: var(--color-error-text);
  padding-left: var(--spacing-xs);
`;export{E as JsonExample};
