ghost-portal/packages/react-params/src/Param/Unknown.tsx
Jaco 8fd9535b4e
Fix Bytes map key queries (#8615)
* Fix Bytes map key queries

* Spread subtype
2022-12-23 17:39:13 +02:00

41 lines
923 B
TypeScript

// Copyright 2017-2022 @polkadot/react-params authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Props as BaseProps } from '../types';
import React from 'react';
import BaseBytes from './BaseBytes';
import Static from './Static';
interface Props extends BaseProps {
children?: React.ReactNode;
}
function Unknown (props: Props): React.ReactElement<Props> {
const { className = '', defaultValue, isDisabled, isError, label, name, onChange, onEnter, onEscape, type } = props;
if (isDisabled) {
return <Static {...props} />;
}
return (
<BaseBytes
asHex
className={className}
defaultValue={defaultValue}
isDisabled={isDisabled}
isError={isError}
label={label}
length={-1}
name={name}
onChange={onChange}
onEnter={onEnter}
onEscape={onEscape}
type={type}
/>
);
}
export default React.memo(Unknown);