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