packageDocumentation module import * as React from "react" ; import { CommonProps } from "@itwin/core-react" ; import { UiIModelComponents } from "../../UiIModelComponents" ; import { ScientificType } from "@itwin/core-quantity" ; import { Select , SelectOption } from "@itwin/itwinui-react" ; internal export interface ScientificTypeSelectorProps extends CommonProps { type : ScientificType ; onChange : ( value : ScientificType ) => void ; disabled ? : boolean ; } internal export function ScientificTypeSelector ( props ) { const { type , onChange , ... otherProps } = props ; const formatOptions = React . useRef < SelectOption < ScientificType > [ ] > ( [ { value : ScientificType . Normalized , label : UiIModelComponents . translate ( "QuantityFormat.scientific-type.normalized" ) } , { value : ScientificType . ZeroNormalized , label : UiIModelComponents . translate ( "QuantityFormat.scientific-type.zero-normalized" ) } , ] ) ; const handleOnChange = React . useCallback ( ( newValue ) => { onChange && onChange ( newValue ) ; } , [ onChange ] ) ; return ( < Select options = { formatOptions . current } value = { type } onChange = { handleOnChange } size = "small" { ... otherProps } />); }