mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
32
scm-ui/ui-components/src/buttons/ButtonGroup.tsx
Normal file
32
scm-ui/ui-components/src/buttons/ButtonGroup.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
className?: string;
|
||||
children: React.Node;
|
||||
};
|
||||
|
||||
class ButtonGroup extends React.Component<Props> {
|
||||
render() {
|
||||
const { className, children } = this.props;
|
||||
|
||||
const childWrapper = [];
|
||||
React.Children.forEach(children, child => {
|
||||
if (child) {
|
||||
childWrapper.push(
|
||||
<div className="control" key={childWrapper.length}>
|
||||
{child}
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={classNames('field', 'is-grouped', className)}>
|
||||
{childWrapper}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ButtonGroup;
|
||||
Reference in New Issue
Block a user