Files
pwap/pezkuwi-sdk-ui/packages/react-params/src/ParamComp.tsx
T
Claude c71ddb6e0d Add Pezkuwi SDK UI - Polkadot.js Apps clone
- Clone Polkadot.js Apps repository
- Update package.json with Pezkuwi branding
- Add Pezkuwi endpoint to production chains (wss://pezkuwichain.app:9944)
- Create comprehensive README for SDK UI
- Set up project structure with all packages

Next steps:
- Apply Kurdistan colors (Kesk, Sor, Zer, Spi + Black) to UI theme
- Replace logos with Pezkuwi branding
- Test build and deployment
2025-11-14 00:55:17 +00:00

55 lines
1.5 KiB
TypeScript

// Copyright 2017-2025 @polkadot/react-params authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Registry, TypeDef } from '@polkadot/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<Props> {
const _onChange = useCallback(
(value: RawParamOnChangeValue): void =>
onChange(index, value),
[index, onChange]
);
return (
<div className='ui--Param-composite'>
<Param
defaultValue={defaultValue}
isDisabled={isDisabled}
isError={isError}
key={`input:${index}`}
name={name}
onChange={_onChange}
onEnter={onEnter}
onEscape={onEscape}
overrides={overrides}
registry={registry}
type={type}
withLength={withLength}
/>
</div>
);
}
export default React.memo(ParamComp);