@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
15 lines (14 loc) • 923 B
JavaScript
import React, { useCallback } from 'react';
import { useAppSelector } from '../app/hooks';
import { selectKioskConfig, selectOrder } from '../slices';
import { default as InputButtonContainer } from './InputButton';
var CheckoutTable = function (_a) {
var label = _a.label, labelStyle = _a.labelStyle, openTable = _a.openTable, InputButtonView = _a.InputButtonView, children = _a.children;
var config = useAppSelector(selectKioskConfig).checkoutTable;
var table = useAppSelector(selectOrder).table;
var renderTableInput = useCallback(function () {
return (React.createElement(InputButtonContainer, { label: label, labelStyle: labelStyle, value: table || '', open: openTable, isRequired: false, children: InputButtonView }));
}, [InputButtonView, label, labelStyle, openTable, table]);
return children({ config: config, renderTableInput: renderTableInput });
};
export default CheckoutTable;