mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 06:32:17 +08:00

* i18n: everything should target @grafana/i18n * wip * chore: updates after PR feedback * Trigger build * Trigger build * Trigger build * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: revert all flaky tests * chore: some incorrect usages of useTranslate
40 lines
847 B
TypeScript
40 lines
847 B
TypeScript
import { PureComponent } from 'react';
|
|
|
|
import { Trans } from '@grafana/i18n';
|
|
|
|
import { CanvasElementItem, CanvasElementProps } from '../element';
|
|
|
|
class NotFoundDisplay extends PureComponent<CanvasElementProps> {
|
|
render() {
|
|
const { config } = this.props;
|
|
return (
|
|
<div>
|
|
<Trans
|
|
i18nKey="canvas.not-found-display.not-found"
|
|
components={{ config: <pre>{JSON.stringify(config, null, 2)}</pre> }}
|
|
>
|
|
<h3>Not found: </h3>
|
|
{'<config />'}
|
|
</Trans>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export const notFoundItem: CanvasElementItem = {
|
|
id: 'not-found',
|
|
name: 'Not found',
|
|
description: 'Display when element type is not found in the registry',
|
|
|
|
display: NotFoundDisplay,
|
|
|
|
defaultSize: {
|
|
width: 100,
|
|
height: 100,
|
|
},
|
|
|
|
getNewOptions: () => ({
|
|
config: {},
|
|
}),
|
|
};
|