mirror of
https://github.com/zoriya/flood.git
synced 2025-12-05 23:06:20 +00:00
31 lines
644 B
TypeScript
31 lines
644 B
TypeScript
import * as React from 'react';
|
|
|
|
import FormRowItem from './FormRowItem';
|
|
|
|
import type {FormRowItemProps} from './FormRowItem';
|
|
|
|
export default class FormRowItemGroup extends React.Component<{
|
|
label?: string;
|
|
width?: FormRowItemProps['width'];
|
|
}> {
|
|
getLabel(): React.ReactNode {
|
|
const {label} = this.props;
|
|
|
|
if (label) {
|
|
return <label className="form__element__label">{label}</label>;
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
render() {
|
|
const {children, width} = this.props;
|
|
|
|
return (
|
|
<FormRowItem className="form__group" width={width}>
|
|
{this.getLabel()}
|
|
{children}
|
|
</FormRowItem>
|
|
);
|
|
}
|
|
}
|