import React from 'react'; import styled from '@emotion/styled'; import GuideAnchor from 'app/components/assistant/guideAnchor'; import ProjectsStore from 'app/stores/projectsStore'; import {Group, GroupTombstone, Organization} from 'app/types'; import {Event} from 'app/types/event'; import {getTitle} from 'app/utils/events'; import withOrganization from 'app/utils/withOrganization'; import StacktracePreview from './stacktracePreview'; type Props = Partial & { data: Event | Group | GroupTombstone; organization: Organization; style?: React.CSSProperties; hasGuideAnchor?: boolean; withStackTracePreview?: boolean; guideAnchorName?: string; }; type DefaultProps = { guideAnchorName: string; }; class EventOrGroupTitle extends React.Component { static defaultProps: DefaultProps = { guideAnchorName: 'issue_title', }; render() { const { hasGuideAnchor, data, organization, withStackTracePreview, guideAnchorName, } = this.props; const {title, subtitle} = getTitle(data as Event, organization); const {id, eventID, groupID, projectID} = data as Event; const titleWithHoverStacktrace = ( {title} ); return subtitle ? ( {titleWithHoverStacktrace} {subtitle}
) : ( {titleWithHoverStacktrace} ); } } 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; `;