UNPKG

@findify/react-components

Version:
36 lines (33 loc) 937 B
/** * @module components/ColorFacet */ import Content from "./content"; import Icon from "../Icon"; import cx from 'classnames'; /** Props that ColorFacet Item accepts */ import { jsx as _jsx } from "react/jsx-runtime"; var Item = function Item(_ref) { var item = _ref.item, theme = _ref.theme, config = _ref.config, isMobile = _ref.isMobile; return /*#__PURE__*/_jsx("button", { role: "checkbox", "aria-checked": item.get('selected') ? 'true' : 'false', tabIndex: 0, className: cx(theme.item, item.get('selected') && theme.active), onClick: item.toggle, children: /*#__PURE__*/_jsx(Content, { item: item, config: config, theme: theme, isMobile: isMobile, children: item.get('selected') ? /*#__PURE__*/_jsx(Icon, { name: "CheckmarkDark", className: theme.check, title: "Selected" }) : null }) }); }; export default Item;