import {Fragment} from 'react'; import styled from '@emotion/styled'; import Access from 'sentry/components/acl/access'; import {useRole} from 'sentry/components/acl/useRole'; import {Button, LinkButton} from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import Confirm from 'sentry/components/confirm'; import FileSize from 'sentry/components/fileSize'; import Link from 'sentry/components/links/link'; import TimeSince from 'sentry/components/timeSince'; import {Tooltip} from 'sentry/components/tooltip'; import {IconClock, IconDelete, IconDownload} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {DebugFile} from 'sentry/types/debugFiles'; import type {ProguardMappingAssociation} from 'sentry/views/settings/projectProguard'; import {ProguardAssociations} from 'sentry/views/settings/projectProguard/associations'; type Props = { downloadUrl: string; mapping: DebugFile; onDelete: (id: string) => void; orgSlug: string; associations?: ProguardMappingAssociation; }; function ProjectProguardRow({ associations = {releases: []}, mapping, onDelete, downloadUrl, orgSlug, }: Props) { const {hasRole, roleRequired: downloadRole} = useRole({role: 'debugFilesRole'}); const {id, debugId, uuid, size, dateCreated} = mapping; const handleDeleteClick = () => { onDelete(id); }; return ( {debugId || uuid || `(${t('empty')})`} , } )} disabled={hasRole} isHoverable > } disabled={!hasRole} href={downloadUrl} title={hasRole ? t('Download Mapping') : undefined} aria-label={t('Download Mapping')} /> {({hasAccess}) => (