import styled from '@emotion/styled'; import {Flex} from 'sentry/components/container/flex'; import SeenInfo from 'sentry/components/group/seenInfo'; import Version from 'sentry/components/version'; import VersionHoverCard from 'sentry/components/versionHoverCard'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Group} from 'sentry/types/group'; import type {Project} from 'sentry/types/project'; import type {Release} from 'sentry/types/release'; import {useApiQuery} from 'sentry/utils/queryClient'; import useOrganization from 'sentry/utils/useOrganization'; import {useFetchAllEnvsGroupData} from 'sentry/views/issueDetails/groupSidebar'; export interface GroupRelease { firstRelease: Release; lastRelease: Release; } export default function FirstLastSeenSection({group}: {group: Group}) { const organization = useOrganization(); const {project} = group; const {data: allEnvironments} = useFetchAllEnvsGroupData(organization, group); const {data: groupReleaseData} = useApiQuery( [`/organizations/${organization.slug}/issues/${group.id}/first-last-release/`], { staleTime: 30000, gcTime: 30000, } ); return (
{t('Last seen')} {group.lastSeen ? ( ) : ( t('N/A') )}
{t('First seen')} {group.firstSeen ? ( ) : ( t('N/A') )}
); } function ReleaseText({project, release}: {project: Project; release?: Release}) { const organization = useOrganization(); if (!release) { return null; } return ( {tct('in release [release]', { release: ( ), })} ); } const ReleaseWrapper = styled('span')` a { color: ${p => p.theme.gray300}; text-decoration: underline; text-decoration-style: dotted; } `; const Title = styled('div')` font-weight: ${p => p.theme.fontWeightBold}; `; const Subtitle = styled('div')` font-size: ${p => p.theme.fontSizeSmall}; color: ${p => p.theme.subText}; `;