/**
 * 课程资料
 *
 * courseId
 * files
 */
import React, { Component } from 'react'

class CourseInfo extends Component {

    render () {
        const files = this.props.files || [];
        return (
            <div className="play-paper">
                <div className="play-paper-body">
                    <div className="play-paper-title"><div><h3>课程资料</h3></div></div>
                    <div className="play-paper-content">
                        {files.length ?
                            <ul className="play-read-files">
                                {files.map((f, i) => {
                                    return <li key={i}><a href={f.file_url} target="_blank">{f.file_name}</a></li>
                                })}
                            </ul>
                            :
                            <p className="no-data">暂无课程资料</p>
                        }

                    </div>
                </div>
            </div>
        );
    }
}

module.exports = CourseInfo;
