"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.SkipNav = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

var _i18n = require("../i18n");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SkipNav = function SkipNav(_ref) {
  var children = _ref.children,
      href = _ref.href,
      onClick = _ref.onClick;
  return /*#__PURE__*/_react.default.createElement("a", {
    className: "ds-c-skip-nav",
    href: href,
    onClick: onClick
  }, children !== null && children !== void 0 ? children : (0, _i18n.t)('skipNav.default'));
};

exports.SkipNav = SkipNav;
SkipNav.propTypes = {
  /**
     * Skip nav label
     */
  children: _propTypes.default.node,

  /**
     * The anchor or target for the link (where the link will jump the user to)
     */
  href: _propTypes.default.string.isRequired,

  /**
     * An onClick handler used for manually setting focus on the content.
     * Sometimes it's necessary to manually set focus, like when an app uses hash
     * routing and element-id links will be mistaken for routes.
     */
  onClick: _propTypes.default.func
};
var _default = SkipNav;
exports.default = _default;