import {css} from '@emotion/react'; import styled from '@emotion/styled'; import FieldGroup from 'sentry/components/forms/fieldGroup'; import {InputGroup} from 'sentry/components/inputGroup'; import {Tooltip} from 'sentry/components/tooltip'; import {t} from 'sentry/locale'; import {organizationSamplingForm} from 'sentry/views/settings/dynamicSampling/utils/organizationSamplingForm'; import {useAccess} from 'sentry/views/settings/projectMetrics/access'; const {useFormField} = organizationSamplingForm; export function OrganizationSampleRateField({}) { const field = useFormField('targetSampleRate'); const {hasAccess} = useAccess({access: ['org:write']}); return ( field.onChange(event.target.value)} /> % {field.hasChanged ? ( {t('previous: %f%%', field.initialValue)} ) : null} ); } const PreviousValue = styled('span')` font-size: ${p => p.theme.fontSizeExtraSmall}; color: ${p => p.theme.subText}; `; const InputWrapper = styled('div')` padding-top: 8px; height: 58px; display: flex; flex-direction: column; gap: 4px; `; const TrailingPercent = styled('strong')` padding: 0 2px; `;