import React from 'react'; import PropTypes from 'prop-types'; import { ButtonGroup, Button, CustomInput } from 'reactstrap'; import { translate } from 'react-i18next'; export class SearchingResultsTopPanel extends React.Component { static propTypes = { noRecords: PropTypes.bool, selectedArticles: PropTypes.array.isRequired, searchResultsCount: PropTypes.number.isRequired, selectAllArticles: PropTypes.func.isRequired, showDeleteArticlesPopup: PropTypes.func.isRequired, showEmailArticlesPopup: PropTypes.func.isRequired, showClipArticlesPopup: PropTypes.func.isRequired, isRefinePanelVisible: PropTypes.bool.isRequired, toggleRefinePanel: PropTypes.func.isRequired, t: PropTypes.func.isRequired }; onShowClick = (e) => { e.preventDefault(); this.props.toggleRefinePanel(); }; selectAllArticles = (e) => { const isChecked = e.target.checked; if (this.props.searchResultsCount > 0) { this.props.selectAllArticles(isChecked); } }; showDeleteArticlesPopup = () => { if (this.props.selectedArticles.length > 0) { this.props.showDeleteArticlesPopup(this.props.selectedArticles); } }; showEmailArticlesPopup = () => { if (this.props.selectedArticles.length > 0) { this.props.showEmailArticlesPopup(this.props.selectedArticles); } }; showClipArticlesPopup = () => { if (this.props.selectedArticles.length > 0) { this.props.showClipArticlesPopup(this.props.selectedArticles); } }; render() { const { t, searchResultsCount, noRecords } = this.props; const chosenArticlesCount = this.props.selectedArticles.length; const isAllArticlesChosen = this.props.searchResultsCount > 0 ? searchResultsCount === chosenArticlesCount : false; if (noRecords) { return null; } return (
{/* */} {!this.props.isRefinePanelVisible && ( )}
); } } export default translate(['tabsContent'], { wait: true })( SearchingResultsTopPanel );