noRowRenderer.tsx 760 B

1234567891011121314151617181920212223242526272829
  1. import type {ReactNode} from 'react';
  2. import {Button} from 'sentry/components/button';
  3. import {IconClose} from 'sentry/icons';
  4. import {t} from 'sentry/locale';
  5. import EmptyState from 'sentry/views/replays/detail/emptyState';
  6. type Props = {
  7. children: ReactNode;
  8. clearSearchTerm: () => void;
  9. unfilteredItems: unknown[];
  10. };
  11. function NoRowRenderer({children, unfilteredItems, clearSearchTerm}: Props) {
  12. return unfilteredItems.length === 0 ? (
  13. <EmptyState>
  14. <p>{children}</p>
  15. </EmptyState>
  16. ) : (
  17. <EmptyState>
  18. <p>{t('No results found')}</p>
  19. <Button icon={<IconClose color="gray500" isCircled />} onClick={clearSearchTerm}>
  20. {t('Clear filters')}
  21. </Button>
  22. </EmptyState>
  23. );
  24. }
  25. export default NoRowRenderer;