import {Fragment} from 'react'; import styled from '@emotion/styled'; import Access from 'sentry/components/acl/access'; import {useRole} from 'sentry/components/acl/useRole'; import Tag from 'sentry/components/badge/tag'; 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 {Project} from 'sentry/types/project'; import {getFeatureTooltip, getPrettyFileType} from './utils'; type Props = { debugFile: DebugFile; downloadUrl: string; onDelete: (id: string) => void; orgSlug: string; project: Project; showDetails: boolean; }; function DebugFileRow({ debugFile, showDetails, downloadUrl, onDelete, orgSlug, project, }: Props) { const {hasRole, roleRequired: downloadRole} = useRole({role: 'debugFilesRole'}); const {id, data, debugId, uuid, size, dateCreated, objectName, symbolType, codeId} = debugFile; const {features} = data || {}; return (
{debugId || uuid}
{symbolType === 'proguard' && objectName === 'proguard-mapping' ? '\u2015' : objectName} {getPrettyFileType(debugFile)} {features && ( {features.map(feature => ( {feature} ))} )} {showDetails && (
{/* there will be more stuff here in the future */} {codeId && ( {t('Code ID')}: {codeId} )}
)}
, } )} isHoverable > } href={downloadUrl} disabled={!hasRole} > {t('Download')} {({hasAccess}) => ( onDelete(id)} disabled={!hasAccess} >