import {Fragment, useCallback} from 'react'; import type {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import {Role} from 'sentry/components/acl/role'; import {Button} from 'sentry/components/button'; import FileSize from 'sentry/components/fileSize'; import Link from 'sentry/components/links/link'; import Pagination from 'sentry/components/pagination'; import Panel from 'sentry/components/panels/panel'; import {PanelTable} from 'sentry/components/panels/panelTable'; import SearchBar from 'sentry/components/searchBar'; import {Tag} from 'sentry/components/tag'; import TimeSince from 'sentry/components/timeSince'; import {Tooltip} from 'sentry/components/tooltip'; import {IconClock, IconDownload} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Artifact, DebugIdBundleArtifact, Project} 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 {DebugIdBundleDeleteButton} from 'sentry/views/settings/projectSourceMaps/debugIdBundleDeleteButton'; import {DebugIdBundleDetails} from 'sentry/views/settings/projectSourceMaps/debugIdBundleDetails'; import {useDeleteDebugIdBundle} from 'sentry/views/settings/projectSourceMaps/useDeleteDebugIdBundle'; enum DebugIdBundleArtifactType { INVALID = 0, SOURCE = 1, MINIFIED_SOURCE = 2, SOURCE_MAP = 3, INDEXED_RAM_BUNDLE = 4, } const debugIdBundleTypeLabels = { [DebugIdBundleArtifactType.INVALID]: t('Invalid'), [DebugIdBundleArtifactType.SOURCE]: t('Source'), [DebugIdBundleArtifactType.MINIFIED_SOURCE]: t('Minified'), [DebugIdBundleArtifactType.SOURCE_MAP]: t('Source Map'), [DebugIdBundleArtifactType.INDEXED_RAM_BUNDLE]: t('Indexed RAM Bundle'), }; function ArtifactsTableRow({ name, downloadRole, downloadUrl, size, type, orgSlug, artifactColumnDetails, }: { artifactColumnDetails: React.ReactNode; downloadRole: string; downloadUrl: string; name: string; orgSlug: string; size: number; type?: string; }) { return ( {name || `(${t('empty')})`} {artifactColumnDetails} {type && {type}} {({hasRole}) => { return ( , } )} disabled={hasRole} isHoverable >