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

20 lines (19 loc) 679 B
import { useAppSelector } from '../app/hooks'; import { useKioskImageUrl } from '../hooks'; import { selectKioskConfig } from '../slices'; var FavsButton = function (_a) { var title = _a.title, path = _a.path, item = _a.item, navigate = _a.navigate, children = _a.children; var config = useAppSelector(selectKioskConfig).favsButton; var imageUrl = 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 }); }; export default FavsButton;