"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = InputGroup;
const classnames_1 = __importDefault(require("classnames"));
const react_1 = __importDefault(require("react"));
function InputGroup(props) {
    var _a, _b;
    const classes = (0, classnames_1.default)('be-form-group', {
        [`s-${props.dimensions}`]: !!props.dimensions,
        'be-form-group--no-marg': props.noMargin,
    });
    let innerLayout;
    const childrenArray = react_1.default.Children.toArray(props.children);
    switch (props.dimensions) {
        case '1/3':
        case '3/1':
        case '2/2':
            innerLayout = (react_1.default.createElement(react_1.default.Fragment, null,
                (childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray[0]) && react_1.default.createElement("div", null, childrenArray[0]),
                (childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray[1]) && react_1.default.createElement("div", { className: ((_b = (_a = childrenArray[1]) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.name) === InputGroup.name ? 'no-marg' : '' }, childrenArray[1])));
            break;
        case '1/2/2':
        case '1/1/1':
            innerLayout = (react_1.default.createElement(react_1.default.Fragment, null,
                (childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray[0]) && react_1.default.createElement("div", null, childrenArray[0]),
                (childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray[1]) && react_1.default.createElement("div", null, childrenArray[1]),
                (childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray[2]) && react_1.default.createElement("div", null, childrenArray[2])));
            break;
        case '1':
        default:
            innerLayout = props.children;
            break;
    }
    return react_1.default.createElement("div", { className: classes }, innerLayout);
}
//# sourceMappingURL=InputGroup.js.map