function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
 * @Author: codingfly
 * @Description:
 * @Date: 2021-08-13 15:39:29
 * @LastEditTime: 2021-09-06 09:00:49
 * @FilePath: \young\components\collapse\index.tsx
 */
import * as React from 'react';
import classNames from 'classnames';
import { View } from 'remax/one';
import { getPrefixCls } from './../common';
import Cell from '../cell';
var prefixCls = getPrefixCls('collapse');

var Collapse = function Collapse(props) {
  var border = props.border,
      children = props.children,
      onChange = props.onChange;

  var getCheckboxs = function getCheckboxs(children, onChange) {
    var onGroupChange = function onGroupChange(e) {
      onChange === null || onChange === void 0 ? void 0 : onChange(e);
    };

    var collapse = React.Children.map(children, function (collapse) {
      var p = (collapse === null || collapse === void 0 ? void 0 : collapse.props) || {};
      var checked = p.checked;
      return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Cell, null));
    });
    return collapse;
  };

  var collapseboxs = getCheckboxs(children, onChange);
  return /*#__PURE__*/React.createElement(View, {
    className: classNames("".concat(prefixCls), _defineProperty({}, "cui-hairline--top-bottom", border))
  }, collapseboxs);
};

export default Collapse;