import styled from '@emotion/styled'; import {Alert} from 'sentry/components/alert'; import SeenByList from 'sentry/components/avatar/seenByList'; import {SectionHeading} from 'sentry/components/charts/styles'; import Times from 'sentry/components/group/times'; import ProjectBadge from 'sentry/components/idBadge/projectBadge'; import Link from 'sentry/components/links/link'; import LoadingError from 'sentry/components/loadingError'; import Placeholder from 'sentry/components/placeholder'; import ShortId from 'sentry/components/shortId'; import GroupChart from 'sentry/components/stream/groupChart'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {TimeseriesValue} from 'sentry/types/core'; import type {Group} from 'sentry/types/group'; import {useApiQuery} from 'sentry/utils/queryClient'; type Props = { eventId: string; groupId: string; }; function LinkedIssue({eventId, groupId}: Props) { const groupUrl = `/issues/${groupId}/`; const { data: group, isPending, isError, error, } = useApiQuery([groupUrl], {staleTime: 0}); if (isPending) { return ; } if (isError || !group) { const hasNotFound = error.status === 404; if (hasNotFound) { return ( {t('The linked issue cannot be found. It may have been deleted, or merged.')} ); } return ; } const issueUrl = `${group.permalink}events/${eventId}/`; const groupStats: ReadonlyArray = group.filtered ? group.filtered.stats?.['30d'] : group.stats?.['30d']; const groupSecondaryStats: ReadonlyArray = group.filtered ? group.stats?.['30d'] : []; return (
{t('Event Issue')} } />
); } const Section = styled('div')` margin-bottom: ${space(4)}; `; const StyledIssueCard = styled('div')` border: 1px solid ${p => p.theme.border}; border-radius: ${p => p.theme.borderRadius}; `; const IssueCardHeader = styled('div')` display: flex; align-items: center; justify-content: space-between; padding: ${space(1)}; `; const StyledLink = styled(Link)` justify-content: flex-start; `; const IssueCardBody = styled('div')` background: ${p => p.theme.backgroundSecondary}; padding-top: ${space(1)}; `; const StyledShortId = styled(ShortId)` font-size: ${p => p.theme.fontSizeMedium}; color: ${p => p.theme.textColor}; `; const IssueCardFooter = styled('div')` color: ${p => p.theme.gray300}; font-size: ${p => p.theme.fontSizeSmall}; padding: ${space(0.5)} ${space(1)}; `; export default LinkedIssue;