import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { icons } from 'Helpers/Props'; import IconButton from 'Components/Link/IconButton'; import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector'; import TableRow from 'Components/Table/TableRow'; import TableRowCell from 'Components/Table/Cells/TableRowCell'; import EpisodeLanguage from 'Episode/EpisodeLanguage'; import EpisodeQuality from 'Episode/EpisodeQuality'; import ArtistNameLink from 'Artist/ArtistNameLink'; import BlacklistDetailsModal from './BlacklistDetailsModal'; import styles from './BlacklistRow.css'; class BlacklistRow extends Component { // // Lifecycle constructor(props, context) { super(props, context); this.state = { isDetailsModalOpen: false }; } // // Listeners onDetailsPress = () => { this.setState({ isDetailsModalOpen: true }); } onDetailsModalClose = () => { this.setState({ isDetailsModalOpen: false }); } // // Render render() { const { series, sourceTitle, language, quality, date, protocol, indexer, message, columns } = this.props; return ( { columns.map((column) => { const { name, isVisible } = column; if (!isVisible) { return null; } if (name === 'series.sortName') { return ( ); } if (name === 'sourceTitle') { return ( {sourceTitle} ); } if (name === 'language') { return ( ); } if (name === 'quality') { return ( ); } if (name === 'date') { return ( ); } if (name === 'indexer') { return ( {indexer} ); } if (name === 'details') { return ( ); } return null; }) } ); } } BlacklistRow.propTypes = { id: PropTypes.number.isRequired, series: PropTypes.object.isRequired, sourceTitle: PropTypes.string.isRequired, language: PropTypes.object.isRequired, quality: PropTypes.object.isRequired, date: PropTypes.string.isRequired, protocol: PropTypes.string.isRequired, indexer: PropTypes.string, message: PropTypes.string, columns: PropTypes.arrayOf(PropTypes.object).isRequired }; export default BlacklistRow;