import {Fragment} from 'react';
import capitalize from 'lodash/capitalize';
import {Alert} from 'sentry/components/alert';
import ExternalLink from 'sentry/components/links/externalLink';
import {t, tct, tn} from 'sentry/locale';
import {IgnoredStatusDetails, Organization} from 'sentry/types';
import ExtraDescription from './extraDescription';
export const BULK_LIMIT = 1000;
export const BULK_LIMIT_STR = BULK_LIMIT.toLocaleString();
export enum ConfirmAction {
RESOLVE = 'resolve',
UNRESOLVE = 'unresolve',
IGNORE = 'ignore',
BOOKMARK = 'bookmark',
UNBOOKMARK = 'unbookmark',
MERGE = 'merge',
DELETE = 'delete',
}
function getBulkConfirmMessage(action: string, queryCount: number) {
if (queryCount > BULK_LIMIT) {
return tct(
'Are you sure you want to [action] the first [bulkNumber] issues that match the search?',
{
action,
bulkNumber: BULK_LIMIT_STR,
}
);
}
return tct(
'Are you sure you want to [action] all [bulkNumber] issues that match the search?',
{
action,
bulkNumber: queryCount,
}
);
}
function PerformanceIssueAlert({
allInQuerySelected,
children,
}: {
allInQuerySelected: boolean;
children: string;
}) {
if (!allInQuerySelected) {
return null;
}
return (
{tct(
'Bulk deletion is only recommended for junk data. To clear your stream, consider resolving or ignoring. [link:When should I delete events?]',
{
link: (
{t('Note that unmerging is currently an experimental feature.')}
{t('This action cannot be undone.')}
: null; } return ({question}