mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
30 lines
760 B
TypeScript
30 lines
760 B
TypeScript
import type {ReactNode} from 'react';
|
|
|
|
import {Button} from 'sentry/components/button';
|
|
import {IconClose} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
import EmptyState from 'sentry/views/replays/detail/emptyState';
|
|
|
|
type Props = {
|
|
children: ReactNode;
|
|
clearSearchTerm: () => void;
|
|
unfilteredItems: unknown[];
|
|
};
|
|
|
|
function NoRowRenderer({children, unfilteredItems, clearSearchTerm}: Props) {
|
|
return unfilteredItems.length === 0 ? (
|
|
<EmptyState>
|
|
<p>{children}</p>
|
|
</EmptyState>
|
|
) : (
|
|
<EmptyState>
|
|
<p>{t('No results found')}</p>
|
|
<Button icon={<IconClose color="gray500" isCircled />} onClick={clearSearchTerm}>
|
|
{t('Clear filters')}
|
|
</Button>
|
|
</EmptyState>
|
|
);
|
|
}
|
|
|
|
export default NoRowRenderer;
|