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

22 lines (21 loc) 813 B
import { useAppSelector } from '../app/hooks'; import { selectKioskConfig } from '../slices'; var Switch = function (_a) { var id = _a.id, label = _a.label, on = _a.on, isRequired = _a.isRequired, disabled = _a.disabled, falseTrackColor = _a.falseTrackColor, thumbColor = _a.thumbColor, trueTrackColor = _a.trueTrackColor, onChange = _a.onChange, children = _a.children; var config = useAppSelector(selectKioskConfig).switch; if (!config) return null; return children({ id: id, config: config, label: label, value: on, onTagSwitch: onChange, isRequired: isRequired, disabled: disabled, falseTrackColor: falseTrackColor, thumbColor: thumbColor, trueTrackColor: trueTrackColor }); }; export default Switch;