import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { icons } from 'Helpers/Props'; import IconButton from 'Components/Link/IconButton'; import VirtualTableHeader from 'Components/Table/VirtualTableHeader'; import VirtualTableHeaderCell from 'Components/Table/VirtualTableHeaderCell'; import TableOptionsModal from 'Components/Table/TableOptions/TableOptionsModal'; import ArtistIndexTableOptionsConnector from './ArtistIndexTableOptionsConnector'; import styles from './ArtistIndexHeader.css'; class ArtistIndexHeader extends Component { // // Lifecycle constructor(props, context) { super(props, context); this.state = { isTableOptionsModalOpen: false }; } // // Listeners onTableOptionsPress = () => { this.setState({ isTableOptionsModalOpen: true }); } onTableOptionsModalClose = () => { this.setState({ isTableOptionsModalOpen: false }); } // // Render render() { const { showSearchAction, columns, onTableOptionChange, ...otherProps } = this.props; return ( { columns.map((column) => { const { name, label, isSortable, isVisible } = column; if (!isVisible) { return null; } if (name === 'actions') { return ( ); } return ( {label} ); }) } ); } } ArtistIndexHeader.propTypes = { columns: PropTypes.arrayOf(PropTypes.object).isRequired, onTableOptionChange: PropTypes.func.isRequired }; export default ArtistIndexHeader;