"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.SubStep = void 0;
var _StepLink = _interopRequireDefault(require("./StepLink"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const SubStep = _ref => {
  let {
    step,
    ...props
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
    role: "listitem",
    className: "ds-c-substep",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: "ds-c-substep__heading",
      children: step.heading
    }), (step.completed || step.started) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepLink.default, {
      component: step.component,
      href: step.href,
      stepId: step.id,
      screenReaderText: step.heading,
      onClick: step.onClick || props.onStepLinkClick,
      className: "ds-c-substep__edit",
      children: step.linkText || props.editText
    }), step.steps && props.showSubSubSteps && /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
      role: "list",
      children: step.steps.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(SubStep, {
        step: s,
        ...props
      }, s.id || i))
    })]
  });
};
exports.SubStep = SubStep;
var _default = exports.default = SubStep;