ghost-portal/packages/react-params/src/Param/Base.tsx
Tarik Gul 384049fb6b
2025 (#11172)
* 2025

* update ci scripts to add access to scripts
2025-01-03 03:59:53 +02:00

42 lines
960 B
TypeScript

// Copyright 2017-2025 @polkadot/react-params authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Size } from '../types.js';
import React from 'react';
import { Labelled } from '@polkadot/react-components';
import Bare from './Bare.js';
interface Props {
children?: React.ReactNode;
className?: string;
isDisabled?: boolean;
isOuter?: boolean;
label?: React.ReactNode;
labelExtra?: React.ReactNode;
size?: Size;
withLabel?: boolean;
}
function Base ({ children, className = '', isOuter, label, labelExtra, size = 'full', withLabel }: Props): React.ReactElement<Props> {
return (
<Bare className={className}>
<Labelled
className={size}
isOuter
label={label}
labelExtra={labelExtra}
withEllipsis
withLabel={withLabel}
>
{!isOuter && children}
</Labelled>
{isOuter && children}
</Bare>
);
}
export default React.memo(Base);