UNPKG

@grafana/ui

Version:
36 lines (33 loc) 1.09 kB
import { jsx } from 'react/jsx-runtime'; import { lazy, Suspense } from 'react'; import { t } from '@grafana/i18n'; import { ErrorBoundaryAlert } from '../ErrorBoundary/ErrorBoundary.mjs'; import { LoadingPlaceholder } from '../LoadingPlaceholder/LoadingPlaceholder.mjs'; "use strict"; const CodeEditor = lazy( () => import( /* webpackChunkName: "react-codemirror-editor" */ './CodeEditor.mjs' ).then((module) => ({ default: module.CodeEditor })) ); function CodeMirrorEditor(props) { return /* @__PURE__ */ jsx( ErrorBoundaryAlert, { boundaryName: "CodeMirrorEditorLazy", title: t("grafana-ui.code-mirror.error-label", "CodeMirror editor failed to load"), style: "page", children: /* @__PURE__ */ jsx( Suspense, { fallback: /* @__PURE__ */ jsx(LoadingPlaceholder, { text: t("grafana-ui.code-mirror.loading-placeholder", "Loading editor") }), children: /* @__PURE__ */ jsx(CodeEditor, { ...props }) } ) } ); } export { CodeMirrorEditor }; //# sourceMappingURL=CodeEditorLazy.mjs.map