Files
2024-02-15 17:01:50 +00:00

23 lines
630 B
TypeScript

import type {ButtonProps} from 'sentry/components/button';
import {LinkButton} from 'sentry/components/button';
import useOrganization from 'sentry/utils/useOrganization';
import usePageFilters from 'sentry/utils/usePageFilters';
export function NewMonitorButton(props: ButtonProps) {
const organization = useOrganization();
const {selection} = usePageFilters();
return (
<LinkButton
to={{
pathname: `/organizations/${organization.slug}/crons/create/`,
query: {project: selection.projects},
}}
priority="primary"
{...props}
>
{props.children}
</LinkButton>
);
}