@open-tender/store
Version:
A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API
19 lines (18 loc) • 985 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importStar(require("react"));
var hooks_1 = require("../app/hooks");
var slices_1 = require("../slices");
var CheckTotals_1 = tslib_1.__importDefault(require("./CheckTotals"));
var CheckoutTotalsContainer = function (_a) {
var check = _a.check, displayGratuity = _a.displayGratuity, children = _a.children, CheckTotalsView = _a.CheckTotalsView;
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).checkoutTotals;
var renderCheckTotals = (0, react_1.useCallback)(function () {
return (react_1.default.createElement(CheckTotals_1.default, { children: CheckTotalsView, check: check, displayGratuity: displayGratuity }));
}, [check, CheckTotalsView]);
if (!config)
return null;
return children({ config: config, renderCheckTotals: renderCheckTotals });
};
exports.default = CheckoutTotalsContainer;