import PropTypes from 'prop-types'; import React, { Component } from 'react'; import ArtistNameLink from 'Artist/ArtistNameLink'; import ArtistStatusCell from 'Artist/Index/Table/ArtistStatusCell'; import TableRowCell from 'Components/Table/Cells/TableRowCell'; import TableSelectCell from 'Components/Table/Cells/TableSelectCell'; import TableRow from 'Components/Table/TableRow'; import TagListConnector from 'Components/TagListConnector'; import formatBytes from 'Utilities/Number/formatBytes'; class ArtistEditorRow extends Component { // // Render render() { const { id, status, foreignArtistId, artistName, artistType, monitored, metadataProfile, qualityProfile, path, statistics, tags, columns, isSaving, isSelected, onArtistMonitoredPress, onSelectedChange } = this.props; return ( { columns.map((column) => { const { name, isVisible } = column; if (!isVisible) { return null; } if (name === 'status') { return ( ); } if (name === 'sortName') { return ( ); } if (name === 'qualityProfileId') { return ( {qualityProfile.name} ); } if (name === 'metadataProfileId') { return ( {metadataProfile.name} ); } if (name === 'path') { return ( {path} ); } if (name === 'sizeOnDisk') { return ( {formatBytes(statistics.sizeOnDisk)} ); } if (name === 'tags') { return ( ); } return null; }) } ); } } ArtistEditorRow.propTypes = { id: PropTypes.number.isRequired, status: PropTypes.string.isRequired, foreignArtistId: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired, artistType: PropTypes.string, monitored: PropTypes.bool.isRequired, metadataProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired, path: PropTypes.string.isRequired, statistics: PropTypes.object.isRequired, tags: PropTypes.arrayOf(PropTypes.number).isRequired, columns: PropTypes.arrayOf(PropTypes.object).isRequired, isSaving: PropTypes.bool.isRequired, isSelected: PropTypes.bool, onArtistMonitoredPress: PropTypes.func.isRequired, onSelectedChange: PropTypes.func.isRequired }; ArtistEditorRow.defaultProps = { tags: [], statistics: {} }; export default ArtistEditorRow;