"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.StepLink = void 0;
var _compat = _interopRequireDefault(require("preact/compat"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var StepLink = function StepLink(props) {
  var _props$component;
  function handleClick(event) {
    if (props.onClick) {
      event.preventDefault();
      props.onClick(props.href, props.stepId);
    }
  }
  var ComponentType = (_props$component = props.component) !== null && _props$component !== void 0 ? _props$component : 'a';
  return /*#__PURE__*/_compat.default.createElement(ComponentType, {
    href: props.href,
    onClick: handleClick,
    className: props.className
  }, props.children, props.screenReaderText && /*#__PURE__*/_compat.default.createElement("span", {
    className: "ds-u-visibility--screen-reader"
  }, " ", props.screenReaderText));
};
exports.StepLink = StepLink;
var _default = StepLink;
exports.default = _default;