Created
October 10, 2020 05:18
-
-
Save vansika/19e2a4b9c123e396cf6599b7929c6244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{getArtistLink(recommendation)} | |
const getArtistLink = (listen: Listen) => { | |
const artistName = _.get(listen, "track_metadata.artist_name"); | |
const firstArtist = _.first( | |
_.get(listen, "track_metadata.additional_info.artist_mbids") | |
); | |
if (firstArtist) { | |
return ( | |
<a | |
href={`http://musicbrainz.org/artist/${firstArtist}`} | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
{artistName} | |
</a> | |
); | |
} | |
return artistName; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment