"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.StepLink = void 0;
var _jsxRuntime = require("preact/compat/jsx-runtime");
const StepLink = props => {
  function handleClick(event) {
    if (props.onClick) {
      event.preventDefault();
      props.onClick(props.href, props.stepId);
    }
  }
  const ComponentType = props.component ?? 'a';
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ComponentType, {
    href: props.href,
    onClick: handleClick,
    className: props.className,
    children: [props.children, props.screenReaderText && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
      className: "ds-u-visibility--screen-reader",
      children: [" ", props.screenReaderText]
    })]
  });
};
exports.StepLink = StepLink;
var _default = exports.default = StepLink;