@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
23 lines (22 loc) • 860 B
JavaScript
import { useAppSelector } from '../app/hooks';
import { selectKioskConfig } from '../slices';
var InputButton = function (_a) {
var label = _a.label, value = _a.value, open = _a.open, isRequired = _a.isRequired, style = _a.style, labelStyle = _a.labelStyle, showOptionalLabel = _a.showOptionalLabel, error = _a.error, children = _a.children;
var _b = useAppSelector(selectKioskConfig), config = _b.inputButton, labelConfig = _b.label;
var handlers = { open: open };
if (!config)
return null;
return children({
config: config,
labelConfig: labelConfig,
handlers: handlers,
label: label,
value: value,
isRequired: isRequired,
style: style,
labelStyle: labelStyle,
showOptionalLabel: showOptionalLabel,
error: error
});
};
export default InputButton;