import PropTypes from 'prop-types'; import React from 'react'; import Label from 'Components/Label'; import Tooltip from 'Components/Tooltip/Tooltip'; import { kinds, sizes, tooltipPositions } from 'Helpers/Props'; import styles from './ArtistGenres.css'; function ArtistGenres({ genres }) { const [firstGenre, ...otherGenres] = genres; if (otherGenres.length) { return ( {firstGenre} } tooltip={
{ otherGenres.map((tag) => { return ( ); }) }
} kind={kinds.INVERSE} position={tooltipPositions.TOP} /> ); } return ( {firstGenre} ); } ArtistGenres.propTypes = { genres: PropTypes.arrayOf(PropTypes.string).isRequired }; export default ArtistGenres;