import {InjectedRouter} from 'react-router'; import styled from '@emotion/styled'; import {navigateTo} from 'sentry/actionCreators/navigation'; import Button from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import CreateAlertButton from 'sentry/components/createAlertButton'; import GlobalSelectionLink from 'sentry/components/globalSelectionLink'; import * as Layout from 'sentry/components/layouts/thirds'; import {IconSettings} from 'sentry/icons'; import {t} from 'sentry/locale'; import ProjectsStore from 'sentry/stores/projectsStore'; import space from 'sentry/styles/space'; import useOrganization from 'sentry/utils/useOrganization'; import usePageFilters from 'sentry/utils/usePageFilters'; type Props = { activeTab: 'stream' | 'rules'; router: InjectedRouter; }; const AlertHeader = ({router, activeTab}: Props) => { const organization = useOrganization(); const {selection} = usePageFilters(); /** * Incidents list is currently at the organization level, but the link needs to * go down to a specific project scope. */ const handleNavigateToSettings = (e: React.MouseEvent) => { e.preventDefault(); navigateTo(`/settings/${organization.slug}/projects/:projectId/alerts/`, router); }; const alertRulesLink = (