import React from 'react';
import classNames from 'classnames';
var Col = function (props) {
    var _a, _b, _c;
    var item = props.item, colon = props.colon, type = props.type, bordered = props.bordered, prefixCls = props.prefixCls;
    var _d = item.props, label = _d.label, children = _d.children, _e = _d.span, span = _e === void 0 ? 1 : _e;
    switch (type) {
        case 'item': {
            var labelCls = classNames(prefixCls + "__item-label", (_a = {},
                _a[prefixCls + "__item_colon"] = colon,
                _a));
            if (bordered) {
                return (React.createElement(React.Fragment, null,
                    React.createElement("th", { className: labelCls, colSpan: 1 }, label),
                    React.createElement("td", { className: prefixCls + "__item-content", colSpan: span * 2 - 1 }, children)));
            }
            else {
                return (React.createElement("td", { className: prefixCls + "__item", colSpan: span },
                    React.createElement("span", { className: labelCls }, label),
                    React.createElement("span", { className: prefixCls + "__item-content" }, children)));
            }
        }
        case 'label': {
            var cls = classNames((_b = {}, _b[prefixCls + "__item"] = !bordered, _b[prefixCls + "__item_colon"] = colon, _b), prefixCls + "__item-label");
            return (React.createElement("th", { className: cls, colSpan: span }, label));
        }
        case 'content': {
            var cls = classNames((_c = {}, _c[prefixCls + "__item"] = !bordered, _c), prefixCls + "__item-content");
            return (React.createElement("td", { className: cls, colSpan: span }, children));
        }
    }
};
export default Col;
//# sourceMappingURL=col.js.map