import _pt from "prop-types";
import React from 'react';
export 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__*/React.createElement(ComponentType, {
    href: props.href,
    onClick: handleClick,
    className: props.className
  }, props.children, props.screenReaderText && /*#__PURE__*/React.createElement("span", {
    className: "ds-u-visibility--screen-reader"
  }, " ", props.screenReaderText));
};
StepLink.propTypes = {
  /**
     * Label text or HTML.
     */
  children: _pt.node.isRequired,
  href: _pt.string,
  stepId: _pt.string,
  screenReaderText: _pt.string,
  className: _pt.string,
  onClick: _pt.func,
  component: _pt.oneOfType([_pt.elementType, _pt.any])
};
export default StepLink;