@findify/react-components
Version:
Findify react UI components
41 lines • 1.19 kB
JavaScript
/**
* @module components/RatingFacet
*/
import content from "./content";
import Button from "../Button";
import Text from "../Text";
import Icon from "../Icon";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export default (function (_ref) {
var item = _ref.item,
theme = _ref.theme,
style = _ref.style,
config = _ref.config;
return /*#__PURE__*/_jsxs(Button, {
style: style,
className: theme.item,
onClick: item.toggle,
role: "checkbox",
"aria-checked": item.get('selected') ? 'true' : 'false',
tabIndex: 0,
children: [/*#__PURE__*/_jsxs(Text, {
primary: true,
lowercase: true,
bold: item.get('selected'),
children: [/*#__PURE__*/_jsx(Icon, {
className: theme.checkbox,
name: item.get('selected') ? 'CheckboxFilled' : 'CheckboxEmpty',
title: item.get('selected') ? 'Selected' : 'Not selected'
}), content({
item: item,
config: config,
theme: theme
})]
}), /*#__PURE__*/_jsxs(Text, {
secondary: true,
uppercase: true,
children: ["(", item.get('count'), ")"]
})]
});
});