import {Fragment} from 'react'; import styled from '@emotion/styled'; import GuideAnchor from 'app/components/assistant/guideAnchor'; import ProjectsStore from 'app/stores/projectsStore'; import {BaseGroup, GroupTombstone, Organization} from 'app/types'; import {Event} from 'app/types/event'; import {getTitle} from 'app/utils/events'; import withOrganization from 'app/utils/withOrganization'; import EventTitleTreeLabel from './eventTitleTreeLabel'; import StacktracePreview from './stacktracePreview'; type Props = Partial & { data: Event | BaseGroup | GroupTombstone; organization: Organization; style?: React.CSSProperties; hasGuideAnchor?: boolean; withStackTracePreview?: boolean; guideAnchorName?: string; }; type DefaultProps = { guideAnchorName: string; }; function EventOrGroupTitle({ guideAnchorName = 'issue_title', organization, data, withStackTracePreview, hasGuideAnchor, style, }: Props) { const event = data as Event; const {id, eventID, groupID, projectID} = event; const {title, subtitle, treeLabel} = getTitle(event, organization?.features); return ( {treeLabel ? : title} {subtitle && ( {subtitle}
)}
); } export default withOrganization(EventOrGroupTitle); /** *   is used instead of margin/padding to split title and subtitle * into 2 separate text nodes on the HTML AST. This allows the * title to be highlighted without spilling over to the subtitle. */ const Spacer = () =>  ; const Subtitle = styled('em')` color: ${p => p.theme.gray300}; font-style: normal; `;