transactionIdCell.tsx 530 B

123456789101112131415161718192021
  1. import Link from 'sentry/components/links/link';
  2. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  3. interface Props {
  4. orgSlug: string;
  5. projectSlug: string;
  6. transactionId: string;
  7. spanId?: string;
  8. }
  9. export function TransactionIdCell({projectSlug, orgSlug, transactionId, spanId}: Props) {
  10. let url = normalizeUrl(
  11. `/organizations/${orgSlug}/performance/${projectSlug}:${transactionId}`
  12. );
  13. if (spanId) {
  14. url += `#span-${spanId}`;
  15. }
  16. return <Link to={url}>{transactionId.slice(0, 8)}</Link>;
  17. }