import type {BaseButtonProps} from 'sentry/components/button'; import {Button} from 'sentry/components/button'; import HookOrDefault from 'sentry/components/hookOrDefault'; import {IconPause, IconPlay} from 'sentry/icons'; import {t} from 'sentry/locale'; import HookStore from 'sentry/stores/hookStore'; import type {ObjectStatus} from 'sentry/types'; import useOrganization from 'sentry/utils/useOrganization'; import type {Monitor} from 'sentry/views/monitors/types'; interface StatusToggleButtonProps extends Omit { monitor: Monitor; onToggleStatus: (status: ObjectStatus) => Promise; } function SimpleStatusToggle({ monitor, onToggleStatus, ...props }: StatusToggleButtonProps) { const organization = useOrganization(); const {status} = monitor; const isDisabled = status === 'disabled'; const monitorCreationCallbacks = HookStore.get('callback:on-monitor-created'); const Icon = isDisabled ? IconPlay : IconPause; const label = isDisabled ? t('Enable this monitor') : t('Disable this monitor and discard incoming check-ins'); return (