UNPKG

react-instantsearch

Version:
34 lines (30 loc) 1.5 kB
'use strict'; var _object_spread = require('@swc/helpers/_/_object_spread'); var _object_spread_props = require('@swc/helpers/_/_object_spread_props'); var _object_without_properties = require('@swc/helpers/_/_object_without_properties'); var instantsearchUiComponents = require('instantsearch-ui-components'); var React = require('react'); function HitsPerPage(_0) { var items = _0.items, onChange = _0.onChange, currentValue = _0.currentValue, _0_classNames = _0.classNames, classNames = _0_classNames === void 0 ? {} : _0_classNames, props = _object_without_properties._(_0, [ "items", "onChange", "currentValue", "classNames" ]); return /*#__PURE__*/ React.createElement("div", _object_spread_props._(_object_spread._({}, props), { className: instantsearchUiComponents.cx('ais-HitsPerPage', classNames.root, props.className) }), /*#__PURE__*/ React.createElement("select", { className: instantsearchUiComponents.cx('ais-HitsPerPage-select', classNames.select), onChange: function onChange1(event) { onChange(Number(event.target.value)); }, value: String(currentValue) }, items.map(function(item) { return /*#__PURE__*/ React.createElement("option", { key: item.value, className: instantsearchUiComponents.cx('ais-HitsPerPage-option', classNames.option), value: item.value }, item.label); }))); } exports.HitsPerPage = HitsPerPage;