import React, {Component} from 'react';
import * as Icon from 'react-feather';
import PropTypes from 'prop-types';
import './Player.css';

class Player extends Component {
  static propTypes = {
    onPlay: PropTypes.func,
  };

  static defaultProps = {
    onPlay: ()=> void(0),
  };

  handlePlay() {
    if (this.props.onPlay) {
      this.props.onPlay();
    }
  }

  render() {
    return (
      <div>
        <span>Player</span>
        <div>
          <a onClick={(evt)=> this.handlePlay(evt)}>
            <Icon.Play />
          </a>
        </div>
      </div>
    );
  }
}

export default Player;
