import styled from '@emotion/styled'; import {openModal} from 'sentry/actionCreators/modal'; import Button from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import {openConfirmModal} from 'sentry/components/confirm'; import CustomIgnoreCountModal from 'sentry/components/customIgnoreCountModal'; import CustomIgnoreDurationModal from 'sentry/components/customIgnoreDurationModal'; import DropdownMenuControl from 'sentry/components/dropdownMenuControl'; import Duration from 'sentry/components/duration'; import Tooltip from 'sentry/components/tooltip'; import {IconChevron, IconMute} from 'sentry/icons'; import {t, tn} from 'sentry/locale'; import { ResolutionStatus, ResolutionStatusDetails, SelectValue, UpdateResolutionStatus, } from 'sentry/types'; const IGNORE_DURATIONS = [30, 120, 360, 60 * 24, 60 * 24 * 7]; const IGNORE_COUNTS = [1, 10, 100, 1000, 10000, 100000]; const IGNORE_WINDOWS: SelectValue[] = [ {value: 60, label: t('per hour')}, {value: 24 * 60, label: t('per day')}, {value: 24 * 7 * 60, label: t('per week')}, ]; type Props = { onUpdate: (params: UpdateResolutionStatus) => void; confirmLabel?: string; confirmMessage?: React.ReactNode; disabled?: boolean; isIgnored?: boolean; shouldConfirm?: boolean; }; const IgnoreActions = ({ onUpdate, disabled, shouldConfirm, confirmMessage, confirmLabel = t('Ignore'), isIgnored = false, }: Props) => { const onIgnore = (statusDetails?: ResolutionStatusDetails) => { openConfirmModal({ bypass: !shouldConfirm, onConfirm: () => onUpdate({ status: ResolutionStatus.IGNORED, statusDetails, }), message: confirmMessage, confirmText: confirmLabel, }); }; const onCustomIgnore = (statusDetails: ResolutionStatusDetails) => { onIgnore(statusDetails); }; if (isIgnored) { return (