// Copyright 2017-2020 @polkadot/react-components authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import { TypeDef } from '@polkadot/types/types'; import { ComponentMap, RawParam, RawParams, RawParamOnChangeValue } from './types'; import React, { useCallback } from 'react'; import Param from './Param'; interface Props { defaultValue: RawParam; index: number; isDisabled?: boolean; name?: string; onChange: (index: number, value: RawParamOnChangeValue) => void; onEnter?: () => void; onEscape?: () => void; overrides?: ComponentMap; type: TypeDef; values?: RawParams | null; } function ParamComp ({ defaultValue, index, isDisabled, name, onChange, onEnter, onEscape, overrides, type }: Props): React.ReactElement { const _onChange = useCallback( (value: RawParamOnChangeValue): void => onChange(index, value), [index] ); return (
); } export default React.memo(ParamComp);