@appcorp/kismaa-web-ui 0.2.99 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,11 +3,13 @@ import { ArrowLeftIcon } from '../../atoms/arrow-left-icon';
|
|
|
3
3
|
import { ArrowRightIcon } from '../../atoms/arrow-right-icon';
|
|
4
4
|
import { Button, BUTTON_SIZES, BUTTON_TYPES } from '../../molecules';
|
|
5
5
|
export var Pagination = function (_a) {
|
|
6
|
-
var currentPage = _a.currentPage, totalPages = _a.totalPages, onPrevious = _a.onPrevious, onNext = _a.onNext;
|
|
6
|
+
var currentPage = _a.currentPage, totalPages = _a.totalPages, onPrevious = _a.onPrevious, onNext = _a.onNext, _b = _a.disablePrevious, disablePrevious = _b === void 0 ? false : _b, _c = _a.disableNext, disableNext = _c === void 0 ? false : _c;
|
|
7
7
|
var renderButton = function (label, isDisabled, onClick, type, iconPrefix, iconSuffix) { return (React.createElement(Button, { label: label, disabled: isDisabled, handleOnClick: onClick, type: type, size: BUTTON_SIZES.SM, iconPrefix: iconPrefix, iconSuffix: iconSuffix })); };
|
|
8
8
|
return (React.createElement("div", { className: "flex items-center justify-center space-x-2", "aria-label": "Pagination" },
|
|
9
|
-
React.createElement("div", { className: "w-fit" }, renderButton('Prev', currentPage === 1, onPrevious, currentPage === 1
|
|
10
|
-
|
|
9
|
+
React.createElement("div", { className: "w-fit" }, renderButton('Prev', disablePrevious || currentPage === 1, onPrevious, disablePrevious || currentPage === 1
|
|
10
|
+
? BUTTON_TYPES.TERTIARY
|
|
11
|
+
: BUTTON_TYPES.PRIMARY, React.createElement(ArrowLeftIcon, { className: "size-3", fill: "currentColor" }))),
|
|
12
|
+
React.createElement("div", { className: "w-fit" }, renderButton('Next', disableNext || currentPage === totalPages, onNext, disableNext || currentPage === totalPages
|
|
11
13
|
? BUTTON_TYPES.TERTIARY
|
|
12
14
|
: BUTTON_TYPES.QUATERNARY, undefined, React.createElement(ArrowRightIcon, { className: "size-3", fill: "currentColor" })))));
|
|
13
15
|
};
|
|
@@ -69,5 +69,5 @@ export var ReviewSection = function (_a) {
|
|
|
69
69
|
React.createElement("div", null,
|
|
70
70
|
React.createElement("p", { className: "mt-4 space-y-6 text-base text-gray-600 italic" }, review.content)))); })))),
|
|
71
71
|
items.length > 0 && (React.createElement("div", { className: "mt-12 flex justify-end" },
|
|
72
|
-
React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: onPageChange, onPrevious: onPrevious, onNext: onNext }))))))));
|
|
72
|
+
React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, onPageChange: onPageChange, onPrevious: onPrevious, onNext: onNext, disablePrevious: currentPage === 1, disableNext: currentPage === totalPages }))))))));
|
|
73
73
|
};
|