import StepLink from "./StepLink";
import { jsx as _jsx, jsxs as _jsxs } from "preact/compat/jsx-runtime";
export const SubStep = _ref => {
  let {
    step,
    ...props
  } = _ref;
  return /*#__PURE__*/_jsxs("li", {
    role: "listitem",
    className: "ds-c-substep",
    children: [/*#__PURE__*/_jsx("div", {
      className: "ds-c-substep__heading",
      children: step.heading
    }), (step.completed || step.started) && /*#__PURE__*/_jsx(StepLink, {
      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__*/_jsx("ul", {
      role: "list",
      children: step.steps.map((s, i) => /*#__PURE__*/_jsx(SubStep, {
        step: s,
        ...props
      }, s.id || i))
    })]
  });
};
export default SubStep;