'use strict';

require('react');
var classnames = require('classnames');
var jsxRuntime = require('react/jsx-runtime');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var classnames__default = /*#__PURE__*/_interopDefault(classnames);

var Stepper = function Stepper(_ref) {
  var steps = _ref.steps,
    activeIndex = _ref.activeIndex,
    setActiveIndex = _ref.setActiveIndex;
  return /*#__PURE__*/jsxRuntime.jsx("div", {
    className: "neeto-ui-stepper__wrapper",
    children: steps.map(function (_ref2, index) {
      var id = _ref2.id,
        label = _ref2.label;
      return /*#__PURE__*/jsxRuntime.jsx("div", {
        "data-testid": "stepper-item-".concat(id),
        className: classnames__default.default("neeto-ui-stepper-item__wrapper", {
          "neeto-ui-stepper-item__wrapper--active": index === activeIndex,
          "neeto-ui-stepper-item__wrapper--done": index < activeIndex
        }),
        children: /*#__PURE__*/jsxRuntime.jsxs("button", {
          className: "neeto-ui-stepper-item",
          "data-testid": "stepper-navigation-button",
          onClick: function onClick() {
            return setActiveIndex(index);
          },
          children: [/*#__PURE__*/jsxRuntime.jsx("span", {
            className: "neeto-ui-stepper-item__stage",
            children: /*#__PURE__*/jsxRuntime.jsx("span", {
              children: id
            })
          }), /*#__PURE__*/jsxRuntime.jsx("span", {
            className: "neeto-ui-stepper-item__label",
            "data-text": label,
            children: label
          })]
        })
      }, id);
    })
  });
};

module.exports = Stepper;
//# sourceMappingURL=Stepper.js.map
