"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.Tabs = void 0;

var _react = _interopRequireDefault(require("react"));

var _HorizontalList = require("../HorizontalList");

var _Button = require("../Button");

var _jsxRuntime = require("react/jsx-runtime");

// Generated with util/create-component.js
const Tabs = props => {
  const {
    items = [],
    value = -1,
    onChange = () => {},
    size = "medium",
    variant = "ghost",
    shape = "square",
    backgroundColor = "primary",
    hoverBackgroundColor = null,
    tabColor = null,
    hoverTabColor = null,
    activeColor = null,
    align = "left",
    children,
    className,
    ...otherProps
  } = props;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_HorizontalList.HorizontalList, { ...otherProps,
    children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
      startIcon: item.icon,
      label: item.label,
      active: index === value,
      shape: shape,
      size: size,
      variant: variant,
      backgroundColor: index === value ? activeColor ? activeColor : backgroundColor : backgroundColor,
      hoverBackgroundColor: hoverBackgroundColor,
      color: tabColor,
      hoverColor: hoverTabColor,
      align: align,
      onClick: () => onChange(index)
    }, index))
  });
};

exports.Tabs = Tabs;