"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _index = require("../../../index");
var _ChevronIcon = _interopRequireDefault(require("./components/ChevronIcon"));
var _CompactComponents = require("./components/CompactComponents");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ChevronLink = function ChevronLink(_ref) {
  var direction = _ref.direction,
    onClick = _ref.onClick,
    label = _ref.label,
    href = _ref.href;
  return _react.default.createElement(_index.Flexbox, {
    item: true,
    container: true,
    alignItems: "center",
    alignContent: "center"
  }, _react.default.createElement(_CompactComponents.StyledLink, {
    onClick: onClick,
    "aria-label": label,
    $direction: direction,
    to: href
  }, _react.default.createElement(_ChevronIcon.default, {
    direction: direction,
    size: 16,
    inline: true
  })));
};
var CompactLinks = function CompactLinks(_ref2) {
  var currentPage = _ref2.currentPage,
    numberOfPages = _ref2.numberOfPages,
    onClickPrevious = _ref2.onClickPrevious,
    onClickNext = _ref2.onClickNext,
    previousPageLabel = _ref2.previousPageLabel,
    nextPageLabel = _ref2.nextPageLabel,
    getPageHref = _ref2.getPageHref;
  return _react.default.createElement(_index.Flexbox, {
    container: true,
    gap: 1,
    alignItems: "center"
  }, currentPage !== 1 && _react.default.createElement(ChevronLink, {
    direction: "left",
    onClick: onClickPrevious,
    label: previousPageLabel,
    href: getPageHref(currentPage - 1)
  }), currentPage !== numberOfPages && _react.default.createElement(_index.Box, {
    ml: currentPage <= 1 ? 9 : 0
  }, _react.default.createElement(ChevronLink, {
    direction: "right",
    onClick: onClickNext,
    label: nextPageLabel,
    href: getPageHref(currentPage + 1)
  })));
};
var _default = exports.default = _react.default.memo(CompactLinks);