import logo from './logo.svg'; import { Link } from 'react-router5' import {formatDuration, slugify} from './utils'; import {getTracks, request} from './Api'; export function fetchTracks(album_id, type, dispatch) { const {url, options} = getTracks(album_id); request(url, options) .then(payload => dispatch({type, payload: {tracks: payload}})) .catch(e => console.log(e)) } export default function Album({album, showArtist, showType, dispatch}) { const artist = slugify(album.artist); return (
{showArtist && (

{album.artist}

)} {showType && (

{album.type}

)}
{album.album} {album.year} {album.country} {album.track_count} @ {formatDuration(album.total_duration)} {album.album} {album.publisher} {album.genre}
) }