import React from 'react' ; import { EuiCodeBlock } from '@elastic/eui' ; import { i18n } from '@osd/i18n' ; import { DocViewRenderProps } from '../../doc_views/doc_views_types' ; export function JsonCodeBlock ( { hit } ) { const label = i18n . translate ( 'discover.docViews.json.codeEditorAriaLabel' , { defaultMessage : 'Read only JSON view of an opensearch document' , } ) ; return ( < EuiCodeBlock aria - label = { label } language = "json" isCopyable paddingSize = "s" > { JSON . stringify ( hit , null , 2 ) } < /EuiCodeBlock>); }