UNPKG

1.34 kBJavaScriptView Raw
1const _excluded = ["children"];
2
3function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
5function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
7import * as PropTypes from 'prop-types';
8import React from 'react';
9import ListOption from './ListOption';
10export const CREATE_OPTION = {};
11const propTypes = {
12 searchTerm: PropTypes.string,
13 focused: PropTypes.bool,
14 onSelect: PropTypes.func.isRequired,
15 activeId: PropTypes.string
16};
17
18function AddToListOption(_ref) {
19 let {
20 children
21 } = _ref,
22 props = _objectWithoutPropertiesLoose(_ref, _excluded);
23
24 return /*#__PURE__*/React.createElement(ListOption, _extends({}, props, {
25 dataItem: CREATE_OPTION,
26 className: 'rw-list-option-create',
27 selected: false
28 }), children);
29}
30
31AddToListOption.propTypes = propTypes;
32export default AddToListOption;
\No newline at end of file