"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VerticalTimeline = VerticalTimeline;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _faPen = require("@fortawesome/free-solid-svg-icons/faPen");
var _verticalTimelineItem = require("./vertical-timeline-item");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const DEFAULT_ICON = _faPen.faPen;

/**
 * VerticalTimeline component.
 * @uxr-only-supported
 */
function VerticalTimeline({
  items = [],
  testId,
  onSelect,
  selected,
  withIcons,
  className
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    "test-id": testId,
    className: (0, _classnames.default)('vertical-timeline', className),
    children: items.map(item => {
      return /*#__PURE__*/(0, _jsxRuntime.jsx)(_verticalTimelineItem.VerticalTimelineItem, {
        ...item,
        icon: withIcons ? item.icon || DEFAULT_ICON : undefined,
        onSelect: onSelect,
        isSelected: selected !== undefined && selected === item.id
      }, item.id);
    })
  });
}