@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
16 lines (15 loc) • 829 B
JavaScript
import React, { useCallback } from 'react';
import { useAppSelector } from '../app/hooks';
import { selectKioskConfig } from '../slices';
import { default as CheckTotalsContainer } from './CheckTotals';
var CheckoutTotalsContainer = function (_a) {
var check = _a.check, displayGratuity = _a.displayGratuity, children = _a.children, CheckTotalsView = _a.CheckTotalsView;
var config = useAppSelector(selectKioskConfig).checkoutTotals;
var renderCheckTotals = useCallback(function () {
return (React.createElement(CheckTotalsContainer, { children: CheckTotalsView, check: check, displayGratuity: displayGratuity }));
}, [check, CheckTotalsView]);
if (!config)
return null;
return children({ config: config, renderCheckTotals: renderCheckTotals });
};
export default CheckoutTotalsContainer;