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

24 lines (23 loc) 897 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var hooks_1 = require("../app/hooks"); var slices_1 = require("../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 = (0, hooks_1.useAppSelector)(slices_1.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 }); }; exports.default = Switch;