// eslint-disable-next-line no-restricted-imports import {withRouter, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; import EventAnnotation from 'sentry/components/events/eventAnnotation'; import GlobalSelectionLink from 'sentry/components/globalSelectionLink'; import InboxReason from 'sentry/components/group/inboxBadges/inboxReason'; import InboxShortId from 'sentry/components/group/inboxBadges/shortId'; import TimesTag from 'sentry/components/group/inboxBadges/timesTag'; import UnhandledTag from 'sentry/components/group/inboxBadges/unhandledTag'; import ReplayCount from 'sentry/components/group/replayCount'; import ProjectBadge from 'sentry/components/idBadge/projectBadge'; import Link from 'sentry/components/links/link'; import Placeholder from 'sentry/components/placeholder'; import {IconChat} from 'sentry/icons'; import {tct} from 'sentry/locale'; import space from 'sentry/styles/space'; import {Group, Organization} from 'sentry/types'; import {Event} from 'sentry/types/event'; import withOrganization from 'sentry/utils/withOrganization'; type Props = WithRouterProps<{orgId: string}> & { data: Event | Group; organization: Organization; showAssignee?: boolean; showInboxTime?: boolean; }; function EventOrGroupExtraDetails({ data, showAssignee, params, showInboxTime, organization, }: Props) { const { id, lastSeen, firstSeen, subscriptionDetails, numComments, logger, assignedTo, annotations, shortId, project, lifetime, isUnhandled, inbox, } = data as Group; const issuesPath = `/organizations/${params.orgId}/issues/`; const isReplayEnabled = organization.features.includes('session-replay-ui'); return ( {inbox && } {shortId && ( ) } /> )} {isUnhandled && } {!lifetime && !firstSeen && !lastSeen ? ( ) : ( )} {/* Always display comment count on inbox */} {numComments > 0 && ( {numComments} )} {isReplayEnabled && } {logger && ( {logger} )} {annotations?.map((annotation, key) => ( ))} {showAssignee && assignedTo && (
{tct('Assigned to [name]', {name: assignedTo.name})}
)}
); } const GroupExtra = styled('div')` display: inline-grid; grid-auto-flow: column dense; gap: ${space(1.5)}; justify-content: start; align-items: center; color: ${p => p.theme.textColor}; font-size: ${p => p.theme.fontSizeSmall}; position: relative; min-width: 500px; white-space: nowrap; line-height: 1.2; a { color: inherit; } @media (min-width: ${p => p.theme.breakpoints.xlarge}) { line-height: 1; } `; const ShadowlessProjectBadge = styled(ProjectBadge)` * > img { box-shadow: none; } `; const CommentsLink = styled(Link)` display: inline-grid; gap: ${space(0.5)}; align-items: center; grid-auto-flow: column; color: ${p => p.theme.textColor}; `; const AnnotationNoMargin = styled(EventAnnotation)` margin-left: 0; padding-left: 0; border-left: none; & > a { color: ${p => p.theme.textColor}; } `; const LoggerAnnotation = styled(AnnotationNoMargin)` color: ${p => p.theme.textColor}; `; export default withRouter(withOrganization(EventOrGroupExtraDetails));