import React from 'react'; import styled from '@emotion/styled'; import Duration from 'sentry/components/duration'; import ProjectBadge from 'sentry/components/idBadge/projectBadge'; import Placeholder from 'sentry/components/placeholder'; import TimeSince from 'sentry/components/timeSince'; import {PlatformKey} from 'sentry/data/platformCategories'; import {IconCalendar, IconClock, IconFire} from 'sentry/icons'; import space from 'sentry/styles/space'; import type {Crumb} from 'sentry/types/breadcrumbs'; import type {EventTransaction} from 'sentry/types/event'; import {defined} from 'sentry/utils'; type Props = { crumbs: Crumb[] | undefined; duration: number | undefined; event: EventTransaction | undefined; }; function EventMetaData({crumbs, duration, event}: Props) { const errors = crumbs?.filter(crumb => crumb.type === 'error').length; return ( {event ? ( ) : ( )} {duration !== undefined ? ( ) : ( )} {defined(errors) ? ( {errors} ) : ( )} ); } function msToSec(ms: number) { return ms / 1000; } const HeaderPlaceholder = styled(function HeaderPlaceholder( props: React.ComponentProps ) { return ; })` background-color: ${p => p.theme.background}; `; const KeyMetrics = styled('div')` display: grid; gap: ${space(3)}; grid-template-columns: repeat(4, max-content); align-items: center; justify-content: end; font-size: ${p => p.theme.fontSizeMedium}; `; const KeyMetricData = styled('div')` color: ${p => p.theme.textColor}; font-weight: normal; display: grid; grid-template-columns: repeat(2, max-content); align-items: center; gap: ${space(1)}; `; export default EventMetaData;