mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* use EmptyState component everywhere in core * remove GrotNotFound core component * update unit tests * search -> not-found * fix 3 more
37 lines
943 B
TypeScript
37 lines
943 B
TypeScript
import { css } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { GrafanaTheme2 } from '@grafana/data';
|
|
import { EmptyState, TextLink, useStyles2 } from '@grafana/ui';
|
|
|
|
export interface Props {
|
|
/**
|
|
* Defaults to Page
|
|
*/
|
|
entity?: string;
|
|
}
|
|
|
|
export function EntityNotFound({ entity = 'Page' }: Props) {
|
|
const styles = useStyles2(getStyles);
|
|
|
|
return (
|
|
<div className={styles.container}>
|
|
<EmptyState message={`${entity} not found`} variant="not-found">
|
|
We're looking but can't seem to find this {entity.toLowerCase()}. Try returning{' '}
|
|
<TextLink href="/">home</TextLink> or seeking help on the{' '}
|
|
<TextLink href="https://community.grafana.com" external>
|
|
community site.
|
|
</TextLink>
|
|
</EmptyState>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function getStyles(theme: GrafanaTheme2) {
|
|
return {
|
|
container: css({
|
|
padding: theme.spacing(8, 2, 2, 2),
|
|
}),
|
|
};
|
|
}
|