import React from 'react'; import PaginationBoxView from '../../paginate/PaginationBoxView'; // eslint-disable-next-line no-unused-vars function pickerWindowWrapper(WrappedComponent, path) { return class extends React.Component { constructor(props) { super(props); this.state = { results: [], pagination: { current_page: 1, total_pages: 0, }, q: null, }; } componentDidMount() { this.fetch(); } fetch() { const data = { page: this.state.pagination.current_page, q: this.state.q, }; const url = Routes[path].call(this, { ...data, ...this.state, ...this.props, }); $.getJSON(url).then(x => this.setState({ ...x })); } onFilterChange(field, event) { this.setState({ [field]: event.target.value }, this.fetch); } pageClick(data) { const selected = data.selected; this.setState( { ...this.state, pagination: { ...this.state.pagination, current_page: selected + 1, }, }, this.fetch ); } pagination() { const breakLabel = (