import React from 'react';
import Tab from "./Tab";
import Button from "./Button";

// 废弃: 使用FooterBar代替
export default function Buttons(_ref) {
  var buttons = _ref.buttons,
    onChange = _ref.onChange;
  return /*#__PURE__*/React.createElement(React.Fragment, null, buttons && buttons.map(function (button, index) {
    if (button.type === 'tab' || button.children) {
      return /*#__PURE__*/React.createElement(Tab, {
        key: (button === null || button === void 0 ? void 0 : button.id) || index,
        disabled: button === null || button === void 0 ? void 0 : button.disabled,
        icon: button === null || button === void 0 ? void 0 : button.icon,
        type: button === null || button === void 0 ? void 0 : button.type,
        id: button === null || button === void 0 ? void 0 : button.id,
        name: button === null || button === void 0 ? void 0 : button.name,
        childrenList: button === null || button === void 0 ? void 0 : button.children,
        onChange: onChange
      });
    }
    return /*#__PURE__*/React.createElement(Button, {
      key: (button === null || button === void 0 ? void 0 : button.id) || index,
      disabled: button === null || button === void 0 ? void 0 : button.disabled,
      type: button === null || button === void 0 ? void 0 : button.type,
      id: button === null || button === void 0 ? void 0 : button.id,
      name: button === null || button === void 0 ? void 0 : button.name,
      primary: button === null || button === void 0 ? void 0 : button.primary,
      onChange: onChange
    });
  }));
}