import {useCallback} from 'react'; import type {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import EventSearchBar from 'sentry/components/events/searchBar'; import * as Layout from 'sentry/components/layouts/thirds'; import {space} from 'sentry/styles/space'; import type {Group} from 'sentry/types/group'; import {browserHistory} from 'sentry/utils/browserHistory'; import useCleanQueryParamsOnRouteLeave from 'sentry/utils/useCleanQueryParamsOnRouteLeave'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; import AllEventsTable from './allEventsTable'; interface Props extends RouteComponentProps<{groupId: string}, {}> { group: Group; } const excludedTags = [ 'environment', 'issue', 'issue.id', 'performance.issue_ids', 'transaction.op', 'transaction.status', ]; function GroupEvents({params, location, group}: Props) { const organization = useOrganization(); const {groupId} = params; useCleanQueryParamsOnRouteLeave({ fieldsToClean: ['cursor', 'query'], shouldClean: newLocation => newLocation.pathname.includes(`/issues/${group.id}/`), }); const handleSearch = useCallback( (query: string) => browserHistory.push( normalizeUrl({ pathname: `/organizations/${organization.slug}/issues/${groupId}/events/`, query: {...location.query, query}, }) ), [location, organization, groupId] ); return ( ); } const AllEventsFilters = styled('div')` margin-bottom: ${space(2)}; `; export default GroupEvents;