import TimeSince from 'sentry/components/timeSince'; import {t, tct} from 'sentry/locale'; import {MonitorType} from 'sentry/types/alerts'; import getDuration from 'sentry/utils/duration/getDuration'; import {hasActiveIncident} from 'sentry/views/alerts/list/rules/utils'; import { type CombinedAlerts, CombinedAlertType, type IssueAlert, type MetricAlert, type UptimeAlert, } from 'sentry/views/alerts/types'; interface Props { rule: CombinedAlerts; } /** * Displays the time since the last uptime incident given an uptime alert rule */ function LastUptimeIncident({rule}: {rule: UptimeAlert}) { // TODO(davidenwang): Once we have a lastTriggered field returned from backend, display that info here return tct('Actively monitoring every [interval]', { interval: getDuration(rule.intervalSeconds), }); } /** * Displays the last time an issue alert was triggered */ function LastIssueTrigger({rule}: {rule: IssueAlert}) { if (!rule.lastTriggered) { return t('Alert not triggered yet'); } return (