Files
grafana/public/app/core/components/PageNotFound/EntityNotFound.tsx
Ashley Harrison 7ad2ec9665 EmptyState: use not-found empty state variant everywhere in core (#85007)
* use EmptyState component everywhere in core

* remove GrotNotFound core component

* update unit tests

* search -> not-found

* fix 3 more
2024-03-27 12:15:12 +00:00

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&apos;re looking but can&apos;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),
}),
};
}