* Bumps w/ eslint * Additional * Additional * Additional * Additional * Remove style props * Additional * Additional * Additional * Additional (< 100) * eslint passes, tsc next * tsc fixes * Update deps * Update i18n
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
// 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 { BareProps } from './types';
|
|
|
|
import React from 'react';
|
|
|
|
import Labelled from './Labelled';
|
|
|
|
interface Props extends BareProps {
|
|
children?: React.ReactNode;
|
|
defaultValue?: any;
|
|
help?: React.ReactNode;
|
|
isDisabled?: boolean;
|
|
isError?: boolean;
|
|
isFull?: boolean;
|
|
isHidden?: boolean;
|
|
label?: React.ReactNode;
|
|
value?: React.ReactNode;
|
|
withLabel?: boolean;
|
|
}
|
|
|
|
function Static ({ children, className = '', defaultValue, help, isFull, isHidden, label, value, withLabel }: Props): React.ReactElement<Props> {
|
|
return (
|
|
<Labelled
|
|
className={className}
|
|
help={help}
|
|
isFull={isFull}
|
|
isHidden={isHidden}
|
|
label={label}
|
|
withLabel={withLabel}
|
|
>
|
|
<div className='ui--Static ui dropdown selection disabled'>
|
|
{value || defaultValue}
|
|
{children}
|
|
</div>
|
|
</Labelled>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Static);
|