trc-client-core
Version:
The core of the TRC Client
30 lines (26 loc) • 825 B
JSX
import React from 'react';
import CourseButton from 'trc-client-core/src/components/CourseButton';
class LearningSegment extends React.Component {
constructor(props) {
super(props);
this.displayName = 'LearningSegment';
}
render() {
var {courses} = this.props;
return <table className="Table hug">
<tbody>
{courses.map(this.renderRow.bind(this)).toJS()}
</tbody>
</table>;
}
renderRow(course, key) {
if(course) {
const {workshopName} = course.toObject();
return <tr key={key}>
<td>{workshopName}</td>
<td><CourseButton course={course} onClick={this.props.onClick.bind(null, course)}/></td>
</tr>
}
}
}
export default LearningSegment;