import styled from '@emotion/styled'; import {indexMembersByProject} from 'sentry/actionCreators/members'; import EmptyStateWarning from 'sentry/components/emptyStateWarning'; import GroupListHeader from 'sentry/components/issues/groupListHeader'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import Pagination, {CursorHandler} from 'sentry/components/pagination'; import Panel from 'sentry/components/panels/panel'; import PanelBody from 'sentry/components/panels/panelBody'; import IssuesReplayCountProvider from 'sentry/components/replays/issuesReplayCountProvider'; import StreamGroup from 'sentry/components/stream/group'; import {t, tct} from 'sentry/locale'; import GroupStore from 'sentry/stores/groupStore'; import {Group, Member} from 'sentry/types'; type Props = { error: string | null; issueCount: number; loading: boolean; members: Member[] | undefined; onCursor: CursorHandler; page: number; pageLinks: string; previewGroups: string[] | null; }; function PreviewTable({ previewGroups, members, pageLinks, onCursor, issueCount, page, loading, error, }: Props) { const renderBody = () => { if (loading) { return ; } if (error || !members) { return ( {error ? error : t('No preview available')} ); } if (issueCount === 0) { return ( {t("We couldn't find any issues that would've triggered your rule")} ); } const memberList = indexMembersByProject(members); return previewGroups?.map((id, index) => { const group = GroupStore.get(id) as Group | undefined; return ( ); }); }; const renderCaption = () => { if (loading || error || !previewGroups) { return null; } const pageIssues = page * 5 + previewGroups.length; return tct(`Showing [pageIssues] of [issueCount] issues`, {pageIssues, issueCount}); }; const renderPagination = () => { if (error) { return null; } return ( ); }; return ( {renderBody()} {renderPagination()} ); } const StyledPagination = styled(Pagination)` margin-top: 0; `; export default PreviewTable;
{error ? error : t('No preview available')}
{t("We couldn't find any issues that would've triggered your rule")}