import AttachmentUrl from 'sentry/components/attachmentUrl'; import UserAvatar from 'sentry/components/avatar/userAvatar'; import Button from 'sentry/components/button'; import DateTime from 'sentry/components/dateTime'; import {DeviceName} from 'sentry/components/deviceName'; import FileSize from 'sentry/components/fileSize'; import GlobalSelectionLink from 'sentry/components/globalSelectionLink'; import {IconPlay} from 'sentry/icons'; import {t} from 'sentry/locale'; import {AvatarUser, Organization, Tag} from 'sentry/types'; import {Event} from 'sentry/types/event'; import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes'; import {useRoutes} from 'sentry/utils/useRoutes'; import withOrganization from 'sentry/utils/withOrganization'; type Props = { event: Event; groupId: string; orgId: string; organization: Organization; projectId: string; tagList: Tag[]; className?: string; hasUser?: boolean; }; function EventsTableRow({ className, event, projectId, orgId, groupId, tagList, hasUser, organization, }: Props) { const routes = useRoutes(); const crashFileLink = !event.crashFile ? null : ( {url => url ? ( {event.crashFile?.type === 'event.minidump' ? 'Minidump' : 'Crash file'}:{' '} {event.crashFile?.name} ( ) ) : null } ); const tagMap = Object.fromEntries(event.tags.map(tag => [tag.key, tag.value])); const hasReplay = Boolean(tagMap.replayId); const fullReplayUrl = { pathname: `/organizations/${organization.slug}/replays/${projectId}:${tagMap.replayId}/`, query: { referrer: getRouteStringFromRoutes(routes), event_t: event.dateCreated ? new Date(event.dateCreated).getTime() : undefined, }, }; return (
{event.title.substr(0, 100)} {crashFileLink}
{hasUser && ( {event.user ? (
{event.user.email}
) : ( )} )} {tagList.map(tag => (
{tag.key === 'device' ? ( ) : tag.key === 'replayId' ? ( hasReplay ? (
))} ); } export default withOrganization(EventsTableRow);