import {Link} from 'react-router'; import DateTime from 'sentry/components/dateTime'; import GridEditable, {GridColumnHeader} from 'sentry/components/gridEditable'; import {useLocation} from 'sentry/utils/useLocation'; import {SpanDurationBar} from 'sentry/views/performance/transactionSummary/transactionSpans/spanDetails/spanDetailsTable'; import {DurationComparisonCell} from 'sentry/views/starfish/components/samplesTable/common'; import { OverflowEllipsisTextContainer, TextAlignRight, } from 'sentry/views/starfish/components/textAlign'; type Keys = 'transaction_id' | 'timestamp' | 'duration' | 'p95_comparison'; type TableColumnHeader = GridColumnHeader; const COLUMN_ORDER: TableColumnHeader[] = [ { key: 'transaction_id', name: 'Event ID', width: 200, }, { key: 'duration', name: 'Span Duration', width: 200, }, { key: 'p95_comparison', name: 'Compared to P95', width: 200, }, ]; type SpanTableRow = { exclusive_time: number; p95Comparison: number; 'project.name': string; spanDuration: number; spanOp: string; span_id: string; timestamp: string; transaction: string; transactionDuration: number; transaction_id: string; user: string; }; type Props = { data: SpanTableRow[]; isLoading: boolean; p95: number; }; export function SpanSamplesTable({isLoading, data, p95}: Props) { const location = useLocation(); function renderHeadCell(column: GridColumnHeader): React.ReactNode { if (column.key === 'p95_comparison') { return ( {column.name} ); } return {column.name}; } function renderBodyCell(column: GridColumnHeader, row: SpanTableRow): React.ReactNode { if (column.key === 'transaction_id') { return ( {row.transaction_id.slice(0, 8)} ); } if (column.key === 'duration') { return ( ); } if (column.key === 'p95_comparison') { return ; } if (column.key === 'timestamp') { return ; } return {row[column.key]}; } return ( ); }