import React, { lazy, Suspense, FunctionComponent } from 'react';
import { cx, css } from 'emotion';
import { LoadingPlaceholder, ErrorBoundary, Button } from '@grafana/ui';
export const LoadingChunkPlaceHolder: FunctionComponent = () => (
);
function getAlertPageStyle() {
return css`
width: 508px;
margin: 128px auto;
`;
}
export const SafeDynamicImport = (importStatement: Promise) => ({ ...props }) => {
const LazyComponent = lazy(() => importStatement);
return (
{({ error, errorInfo }) => {
if (!errorInfo) {
return (
}>
);
}
return (
Unable to find application file
Grafana has likely been updated. Please try reloading the page.
{error && error.toString()}
{errorInfo.componentStack}
);
}}
);
};