ghost-portal/packages/react-components/src/Static.tsx
Jaco Greeff 6a393256a4
Bump API, cater for new OpenTip structure (#3096)
* Bump API, cater for new OpenTip structure

* Simplify assignment

* Cleanups after latest typescript-eslint breakages

* More...

* Last-ish round
2020-06-30 13:43:06 +02:00

42 lines
1.0 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 React from 'react';
import Labelled from './Labelled';
interface Props {
children?: React.ReactNode;
className?: string;
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);