mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
30 lines
618 B
JavaScript
30 lines
618 B
JavaScript
// @flow
|
|
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(<p className="control" key={childWrapper.length}>{child}</p>);
|
|
}
|
|
});
|
|
|
|
return (
|
|
<div className={classNames("field", "is-grouped", className)}>
|
|
{childWrapper}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default ButtonGroup;
|