mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
EmptyState: Rename "search" variant to "not-found" (#85062)
* rename "search" variant to "not-found" * run i18n:extract
This commit is contained in:
@@ -5,7 +5,7 @@ import { EmptyState } from './EmptyState';
|
||||
|
||||
Use an empty state to communicate to the user that there is no data to display, or that a search query returned no results.
|
||||
|
||||
## variant="search"
|
||||
## variant="not-found"
|
||||
|
||||
### When to use
|
||||
|
||||
@@ -16,7 +16,7 @@ There are sensible defaults for the image and message, so in most cases you can
|
||||
```jsx
|
||||
import { EmptyState } from '@grafana/ui';
|
||||
|
||||
<EmptyState variant="search" />;
|
||||
<EmptyState variant="not-found" />;
|
||||
```
|
||||
|
||||
### Providing custom overrides
|
||||
@@ -30,6 +30,7 @@ import { Button, EmptyState } from '@grafana/ui';
|
||||
button={<Button variant="secondary" onClick={clearSearchQuery} />}
|
||||
image={<AnyReactNode />}
|
||||
message="No playlists found"
|
||||
variant="not-found"
|
||||
>
|
||||
Optionally provide some additional information here. Maybe even a link to{' '}
|
||||
<TextLink href="<externalDocsLink>" external>
|
||||
|
||||
@@ -28,6 +28,7 @@ export const Basic: StoryFn<typeof EmptyState> = (args) => {
|
||||
|
||||
Basic.args = {
|
||||
children: 'Use this space to add any additional information',
|
||||
variant: 'not-found',
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
@@ -24,14 +24,14 @@ interface Props {
|
||||
/**
|
||||
* Empty state variant. Possible values are 'search'.
|
||||
*/
|
||||
variant: 'search';
|
||||
variant: 'not-found';
|
||||
}
|
||||
|
||||
export const EmptyState = ({
|
||||
button,
|
||||
children,
|
||||
image = <GrotNotFound width={300} />,
|
||||
message = t('grafana-ui.empty-state.search-message', 'No results found'),
|
||||
message = t('grafana-ui.empty-state.not-found-message', 'No results found'),
|
||||
hideImage = false,
|
||||
}: React.PropsWithChildren<Props>) => {
|
||||
return (
|
||||
|
||||
@@ -564,7 +564,7 @@
|
||||
"close": "Close"
|
||||
},
|
||||
"empty-state": {
|
||||
"search-message": "No results found"
|
||||
"not-found-message": "No results found"
|
||||
},
|
||||
"modal": {
|
||||
"close-tooltip": "Close"
|
||||
|
||||
@@ -564,7 +564,7 @@
|
||||
"close": "Cľőşę"
|
||||
},
|
||||
"empty-state": {
|
||||
"search-message": "Ńő řęşūľŧş ƒőūʼnđ"
|
||||
"not-found-message": "Ńő řęşūľŧş ƒőūʼnđ"
|
||||
},
|
||||
"modal": {
|
||||
"close-tooltip": "Cľőşę"
|
||||
|
||||
Reference in New Issue
Block a user