// Copyright 2017-2026 @pezkuwi/react-params authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { Registry, TypeDef } from '@pezkuwi/types/types'; import type { ComponentMap, RawParam, RawParamOnChangeValue, RawParams } from './types.js'; import React, { useCallback } from 'react'; import Param from './Param/index.js'; interface Props { defaultValue: RawParam; index: number; isDisabled?: boolean; isError?: boolean; name?: string; onChange: (index: number, value: RawParamOnChangeValue) => void; onEnter?: () => void; onEscape?: () => void; overrides?: ComponentMap; registry: Registry; type: TypeDef; values?: RawParams | null; withLength?: boolean; } function ParamComp ({ defaultValue, index, isDisabled, isError, name, onChange, onEnter, onEscape, overrides, registry, type, withLength = true }: Props): React.ReactElement { const _onChange = useCallback( (value: RawParamOnChangeValue): void => onChange(index, value), [index, onChange] ); return (
); } export default React.memo(ParamComp);