grafana/public/app/features/playlist/EmptyQueryListBanner.tsx
Uchechukwu Obasi eb2e1197e9
PlaylistPage: fix search input (#39226)
* PlaylistPage: removes search due to no wildcard support

* PlaylistPage: adds back search input and wildcard search support

* makes banner to appear only when playlist does not exist

* Chore: small refactor

* Chore: some code refactoring to make it readable

* fixes focus leaving input when query is cleared

* adds styling to the emptyQueryList banner

* extracts emptyQueryListBanner component to a separate file

* adds debounce to search

* use new theme for styling

* Chore: some nit fix

* fixes empty list banner showing for a second before the full list is loaded

* Fix: removes search when playlist is empty

Co-authored-by: Ash <ashharrison90@gmail.com>

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-09-22 10:45:29 +01:00

21 lines
551 B
TypeScript

import React from 'react';
import { useStyles2 } from '@grafana/ui';
import { GrafanaTheme2 } from '@grafana/data';
import { css } from '@emotion/css';
export const EmptyQueryListBanner = () => {
const styles = useStyles2(getStyles);
return <div className={styles.noResult}>No playlist found!</div>;
};
const getStyles = (theme: GrafanaTheme2) => {
return {
noResult: css`
padding: ${theme.spacing(2)};
background: ${theme.colors.secondary.main};
font-style: italic;
margin-top: ${theme.spacing(2)};
`,
};
};