import * as React from 'react';
import classNames from '../../../utils/classnames';
import './index.css';
import { usePlatform } from '../../../utils/platform';
import { ConfigProvider, Form as TeaForm } from 'tea-component';
export default function FormCell(_a) {
    var _b;
    var className = _a.className, style = _a.style, label = _a.label, layout = _a.layout, children = _a.children, multiCell = _a.multiCell, requiredFlag = _a.requiredFlag, size = _a.size;
    var platform = usePlatform();
    var isFlex = layout !== 'vertical';
    if (platform === 'pc') {
        return (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
            React.createElement(TeaForm.Item, { style: style, className: classNames((_b = {
                        'weda-ui': true,
                        'weui-cells_forms': !multiCell,
                        'weui-cells_checkbox': multiCell,
                        'weda-formcells__pc': !!label,
                        'weda-formcells__full-width': size === 'full'
                    },
                    _b[layout] = layout,
                    _b[className] = [className],
                    _b)), labelVisible: !!label, label: label }, children)));
    }
    return (React.createElement("div", { className: className, style: style },
        React.createElement("div", { className: classNames({
                'weda-formcells': true,
                'weui-cells': true,
                'weui-cells_forms': !multiCell,
                'weui-cells_checkbox': multiCell,
                'weui-flex': isFlex,
            }) },
            label ? (React.createElement("div", { className: classNames({
                    'weda-formcells__label': true,
                    // 标题也采用使用weui-cell的样式
                    'weui-cell': true,
                }) },
                requiredFlag ? (React.createElement("label", { className: "weda-formcells__flag" }, "*")) : null,
                React.createElement("label", null, label))) : null,
            React.createElement("div", { className: classNames({
                    'weda-formcells__content': true,
                    'weui-flex__item': isFlex,
                }) }, children))));
}
//# sourceMappingURL=index.js.map