UNPKG

@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) 743 B
import { useAppSelector } from '../app/hooks'; import { selectKioskConfig } from '../slices'; var Input = function (_a) { var label = _a.label, value = _a.value, setValue = _a.setValue, isRequired = _a.isRequired, style = _a.style, children = _a.children; var _b = useAppSelector(selectKioskConfig), config = _b.input, labelConfig = _b.label; var update = function (evt) { setValue(evt.target.value); }; var handlers = { update: update }; if (!config) return null; return children({ config: config, handlers: handlers, label: label, value: value, isRequired: isRequired, style: style, labelConfig: labelConfig }); }; export default Input;