import {RouteComponentProps} from 'react-router'; import Field from 'sentry/components/forms/field'; import RangeField from 'sentry/components/forms/fields/rangeField'; import Form from 'sentry/components/forms/form'; import {Panel, PanelAlert, PanelBody, PanelHeader} from 'sentry/components/panels'; import {t, tct} from 'sentry/locale'; import {Organization} from 'sentry/types'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import TextBlock from 'sentry/views/settings/components/text/textBlock'; type Props = RouteComponentProps<{}, {}> & { organization: Organization; }; const getRateLimitValues = () => { const steps: number[] = []; let i = 0; while (i <= 1_000_000) { steps.push(i); if (i < 10_000) { i += 1_000; } else if (i < 100_000) { i += 10_000; } else { i += 100_000; } } return steps; }; // We can just generate this once const ACCOUNT_RATE_LIMIT_VALUES = getRateLimitValues(); const OrganizationRateLimit = ({organization}: Props) => { // TODO(billy): Update organization.quota in organizationStore with new values const {quota} = organization; const {maxRate, maxRateInterval, projectLimit, accountLimit} = quota; const initialData = { projectRateLimit: projectLimit || 100, accountRateLimit: accountLimit, }; return (