import styled from '@emotion/styled'; import {CopyToClipboardButton} from 'sentry/components/copyToClipboardButton'; import ProjectBadge from 'sentry/components/idBadge/projectBadge'; import ExternalLink from 'sentry/components/links/externalLink'; import {Tooltip} from 'sentry/components/tooltip'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import useProjects from 'sentry/utils/useProjects'; import type {TraceTree} from '../traceModels/traceTree'; interface TitleProps { representativeTransaction: TraceTree.Transaction | null; traceSlug: string; } export function Title({traceSlug, representativeTransaction}: TitleProps) { const traceTitle = representativeTransaction ? { op: representativeTransaction['transaction.op'], transaction: representativeTransaction.transaction, } : null; const {projects} = useProjects(); const project = projects.find(p => p.slug === representativeTransaction?.project_slug); return (
{traceTitle ? ( traceTitle.transaction ? ( {project && ( )} {traceTitle.op} - {traceTitle.transaction} ) : ( '\u2014' ) ) : ( , link: ( ), } )} showUnderline position="right" isHoverable > {t('Missing Trace Root')} )} Trace ID: {traceSlug}
); } const TitleWrapper = styled('div')` display: flex; gap: ${space(0.5)}; align-items: center; `; const TitleText = styled('div')` font-size: ${p => p.theme.fontSizeExtraLarge}; ${p => p.theme.overflowEllipsis}; `; const SubtitleText = styled('div')` font-size: ${p => p.theme.fontSizeMedium}; color: ${p => p.theme.subText}; `;