import PropTypes from 'prop-types'; import React, { Component } from 'react'; import Button from 'Components/Link/Button'; import LoadingIndicator from 'Components/Loading/LoadingIndicator'; import ModalContent from 'Components/Modal/ModalContent'; import ModalHeader from 'Components/Modal/ModalHeader'; import ModalBody from 'Components/Modal/ModalBody'; import ModalFooter from 'Components/Modal/ModalFooter'; import Table from 'Components/Table/Table'; import TableBody from 'Components/Table/TableBody'; import ArtistHistoryRowConnector from './ArtistHistoryRowConnector'; const columns = [ { name: 'eventType', isVisible: true }, { name: 'album', label: 'Album', isVisible: true }, { name: 'sourceTitle', label: 'Source Title', isVisible: true }, { name: 'quality', label: 'Quality', isVisible: true }, { name: 'date', label: 'Date', isVisible: true }, { name: 'details', label: 'Details', isVisible: true }, { name: 'actions', label: 'Actions', isVisible: true } ]; class ArtistHistoryModalContent extends Component { // // Render render() { const { albumId, isFetching, isPopulated, error, items, onMarkAsFailedPress, onModalClose } = this.props; const fullArtist = albumId == null; const hasItems = !!items.length; return ( History { isFetching && } { !isFetching && !!error &&
Unable to load history.
} { isPopulated && !hasItems && !error &&
No history.
} { isPopulated && hasItems && !error && { items.map((item) => { return ( ); }) }
}
); } } ArtistHistoryModalContent.propTypes = { albumId: PropTypes.number, isFetching: PropTypes.bool.isRequired, isPopulated: PropTypes.bool.isRequired, error: PropTypes.object, items: PropTypes.arrayOf(PropTypes.object).isRequired, onMarkAsFailedPress: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired }; export default ArtistHistoryModalContent;