import React, { Component } from 'react';
import './index.scss';

class CourseItem extends Component {
  render() {
    const { image,toCourse,id} = this.props;
    return (
      <div className="course-container">
        <div className="course__cover">
          <img src={image} alt="cover" onClick={() => toCourse(id)}/>
        </div>
        {this.props.children}
      </div>
    );
  }
}

export default CourseItem;