import {Fragment, useCallback, useEffect} from 'react'; import {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'sentry/actionCreators/indicator'; import Access from 'sentry/components/acl/access'; import Badge from 'sentry/components/badge'; import {Button} from 'sentry/components/button'; import Confirm from 'sentry/components/confirm'; import Count from 'sentry/components/count'; import DateTime from 'sentry/components/dateTime'; import ExternalLink from 'sentry/components/links/externalLink'; import Link from 'sentry/components/links/link'; import ListLink from 'sentry/components/links/listLink'; import NavTabs from 'sentry/components/navTabs'; import Pagination from 'sentry/components/pagination'; import {PanelTable} from 'sentry/components/panels'; import SearchBar from 'sentry/components/searchBar'; import {Tooltip} from 'sentry/components/tooltip'; import {IconArrow, IconDelete, IconWarning} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {DebugIdBundle, Project, SourceMapsArchive} from 'sentry/types'; import {useApiQuery} from 'sentry/utils/queryClient'; import {decodeScalar} from 'sentry/utils/queryString'; import useApi from 'sentry/utils/useApi'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; import {DebugIdBundlesTags} from 'sentry/views/settings/projectSourceMaps/debugIdBundlesTags'; enum SORT_BY { ASC = 'date_added', DESC = '-date_added', } enum SourceMapsBundleType { Release, DebugId, } function SourceMapsTableRow({ bundleType, onDelete, name, fileCount, link, date, idColumnDetails, }: { bundleType: SourceMapsBundleType; date: string; fileCount: number; link: string; name: string; onDelete: (name: string) => void; idColumnDetails?: React.ReactNode; }) { const isEmptyReleaseBundle = bundleType === SourceMapsBundleType.Release && fileCount === -1; return ( {isEmptyReleaseBundle ? name : {name}} {idColumnDetails} {isEmptyReleaseBundle ? ( ) : ( )} {isEmptyReleaseBundle ? t('(no value)') : } {isEmptyReleaseBundle ? (