import {Fragment, useCallback, useEffect, useState} 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 {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/panelTable'; import QuestionTooltip from 'sentry/components/questionTooltip'; import SearchBar from 'sentry/components/searchBar'; import {Tooltip} from 'sentry/components/tooltip'; import {IconArrow, IconDelete} 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 {DebugIdBundleList} from 'sentry/views/settings/projectSourceMaps/debugIdBundleList'; import {useDeleteDebugIdBundle} from 'sentry/views/settings/projectSourceMaps/useDeleteDebugIdBundle'; enum SortBy { ASC_ADDED = 'date_added', DESC_ADDED = '-date_added', ASC_MODIFIED = 'date_modified', DESC_MODIFIED = '-date_modified', } enum SourceMapsBundleType { RELEASE, DEBUG_ID, } function SourceMapsTableRow({ bundleType, onDelete, name, fileCount, link, dateModified, date, idColumnDetails, }: { bundleType: SourceMapsBundleType; date: string; fileCount: number; link: string; name: string; onDelete: (name: string) => void; dateModified?: string; idColumnDetails?: React.ReactNode; }) { const isEmptyReleaseBundle = bundleType === SourceMapsBundleType.RELEASE && fileCount === -1; const showDateModified = bundleType === SourceMapsBundleType.DEBUG_ID && dateModified !== undefined; return ( {isEmptyReleaseBundle ? name : {name}} {idColumnDetails} {isEmptyReleaseBundle ? ( {'0'} ) : ( )} {showDateModified && ( )} {isEmptyReleaseBundle ? t('(no value)') : } {isEmptyReleaseBundle ? (