import {Fragment} from 'react'; import GlobalSelectionLink from 'sentry/components/globalSelectionLink'; import { ActivationConditionType, ActivationTrigger, type ActivationTriggerActivity, } from 'sentry/types/alerts'; import type {Organization} from 'sentry/types/organization'; import getDynamicText from 'sentry/utils/getDynamicText'; import {StyledDateTime} from 'sentry/views/alerts/rules/metric/details/styles'; type MetricHistoryActivationProps = { activationActivity: ActivationTriggerActivity; organization: Organization; }; export default function MetricHistoryActivation({ activationActivity, organization, }: MetricHistoryActivationProps) { let trigger; let activator; switch (activationActivity.conditionType) { case String(ActivationConditionType.RELEASE_CREATION): activator = ( {activationActivity.activator} ); trigger = Release {activator} created.; break; case String(ActivationConditionType.DEPLOY_CREATION): activator = activationActivity.activator; trigger = `Deploy ${activator} created.`; break; default: trigger = '--'; } return (
{trigger}{' '} {activationActivity.type === ActivationTrigger.ACTIVATED ? 'Start monitoring.' : 'Finish monitoring.'}
); }