@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) • 766 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var hooks_1 = require("../app/hooks");
var hooks_2 = require("../hooks");
var slices_1 = require("../slices");
var FavsButton = function (_a) {
var title = _a.title, path = _a.path, item = _a.item, navigate = _a.navigate, children = _a.children;
var config = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig).favsButton;
var imageUrl = (0, hooks_2.useKioskImageUrl)(item);
var browse = function () { return navigate(path); };
var handlers = { browse: browse };
if (!config)
return null;
return children({
config: config,
handlers: handlers,
title: title,
imageUrl: imageUrl
});
};
exports.default = FavsButton;