const _excluded = ["onClick", "children"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
import React from "react";
import PropTypes from "prop-types";
import { IconButton } from "@mui/material";
import EastOutlinedIcon from "@mui/icons-material/EastOutlined";
import WestOutlinedIcon from "@mui/icons-material/WestOutlined";
import useTranslation from "../../utils/useTranslation";
function CycleButton(_ref) {
  let {
      onClick,
      children
    } = _ref,
    props = _objectWithoutProperties(_ref, _excluded);
  const {
    t
  } = useTranslation();
  return /*#__PURE__*/React.createElement(IconButton, _extends({
    sx: {
      padding: 0,
      height: 25,
      width: 25
    },
    className: "wkp-pagination-button",
    title: t("zurück"),
    "aria-label": t("zurück"),
    onClick: onClick
  }, props), children);
}
CycleButton.propTypes = {
  onClick: PropTypes.func.isRequired,
  children: PropTypes.node.isRequired
};
function CycleButtonWrapper(_ref2) {
  let {
    children
  } = _ref2;
  return /*#__PURE__*/React.createElement("span", {
    style: {
      padding: "0 10px",
      height: 25,
      width: 25
    },
    className: "wkp-pagination-button-wrapper"
  }, children);
}
CycleButtonWrapper.propTypes = {
  children: PropTypes.node.isRequired
};
function Pagination(_ref3) {
  let {
    onNext,
    onPrevious,
    index,
    count
  } = _ref3;
  const {
    t
  } = useTranslation();
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      height: 35
    },
    className: "wkp-pagination-wrapper"
  }, /*#__PURE__*/React.createElement(CycleButtonWrapper, null, index > 0 && /*#__PURE__*/React.createElement(CycleButton, {
    onClick: onPrevious,
    "data-testid": "pagination-previous-button"
  }, /*#__PURE__*/React.createElement(WestOutlinedIcon, {
    sx: {
      height: 16,
      width: 16
    }
  }))), index + 1, " ", t("von"), " ", count, /*#__PURE__*/React.createElement(CycleButtonWrapper, null, index < count - 1 && /*#__PURE__*/React.createElement(CycleButton, {
    onClick: onNext,
    "data-testid": "pagination-next-button"
  }, /*#__PURE__*/React.createElement(EastOutlinedIcon, {
    sx: {
      height: 16,
      width: 16
    }
  }))));
}
Pagination.propTypes = {
  onNext: PropTypes.func.isRequired,
  onPrevious: PropTypes.func.isRequired,
  index: PropTypes.number.isRequired,
  count: PropTypes.number.isRequired
};
export default Pagination;
//# sourceMappingURL=Pagination.js.map