newMonitorButton.tsx 584 B

123456789101112131415161718192021
  1. import {ButtonProps, LinkButton} from 'sentry/components/button';
  2. import useOrganization from 'sentry/utils/useOrganization';
  3. import usePageFilters from 'sentry/utils/usePageFilters';
  4. export function NewMonitorButton(props: ButtonProps) {
  5. const organization = useOrganization();
  6. const {selection} = usePageFilters();
  7. return (
  8. <LinkButton
  9. to={{
  10. pathname: `/organizations/${organization.slug}/crons/create/`,
  11. query: {project: selection.projects},
  12. }}
  13. priority="primary"
  14. {...props}
  15. >
  16. {props.children}
  17. </LinkButton>
  18. );
  19. }