All files / src/components Recommendations.jsx

66.67% Statements 4/6
75% Branches 3/4
50% Functions 1/2
80% Lines 4/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18          1x 1x 1x 1x                  
import React, { Component } from "react";
import Albums from "./Albums";
 
export default class Recommendations extends Component {
  render() {
    const { tracks = [], album = {}, handleClick } = this.props;
    let aname = "";
    Iif (album.name) aname = ` for ${album.artists[0].name}`;
    return (
      <Albums
        title={"Recommendations" + aname}
        albums={tracks.map(a => a.album)}
        handleClick={handleClick}
      />
    );
  }
}