/* eslint-disable react/jsx-no-bind */ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { translate } from 'react-i18next'; import { Button, CustomInput, Table } from 'reactstrap'; import { IoIosCloseCircleOutline } from 'react-icons/io'; import { capitalize } from 'lodash'; import { getTitle } from '../../../../../../common/helper'; export class SourcesTabSelectedSources extends React.Component { static propTypes = { searchBySourcesType: PropTypes.string.isRequired, selectedSources: PropTypes.array.isRequired, removeSelectedSearchBySource: PropTypes.func.isRequired, clearSearchBySources: PropTypes.func.isRequired, includeExcludeSearchBySources: PropTypes.func.isRequired, t: PropTypes.func.isRequired }; removeSource = (sourceId) => { this.props.removeSelectedSearchBySource(sourceId); }; includeExclide = (type) => { this.props.includeExcludeSearchBySources(type); }; render() { const { selectedSources } = this.props; const { t } = this.props; return (
this.includeExclide('include')} label={t('searchTab.searchBySection.sources.includeText')} /> this.includeExclide('exclude')} label={t('searchTab.searchBySection.sources.excludeText')} />

{t('searchTab.searchBySection.sources.selectedSources')}

{selectedSources.length > 0 ? ( selectedSources.map((source, i) => { return ( {/* */} ); }) ) : ( )}
{t('searchTab.searchBySection.sources.source')} {t('searchTab.searchBySection.sources.mediatype')}
{getTitle(source.title)} {capitalize(source.type) || '-'}
{t('common:messages.noRows')}
{t('searchTab.searchBySection.sources.selectSource')}
{selectedSources.length > 0 && ( )}
); } } export default translate(['tabsContent'], { wait: true })( SourcesTabSelectedSources );