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