import React, { Component } from 'react' import { connect } from 'react-redux' import actions from 'app/actions' import { ROMAN_NUMERALS } from 'app/constants' import { pad } from 'app/utils' import { thumbnailURL } from 'app/views/align/align.util' import { PlayIcon } from '../nav/viewer.icons' class ChecklistContent extends Component { render() { const { sections, currentSection } = this.props return (
{sections.map(section => { if ((currentSection !== "all" && section.index !== currentSection) || !section.media.length) { return
} return (
{section.media.map((media, i) => (
{pad(section.mediaIndex + i + 1, 2)}
{ROMAN_NUMERALS[section.index]}
{section.title}
{media.author}
{media.pre_title && (media.pre_title + ' ')} {media.title} {media.post_title && (' ' + media.post_title)}
{media.year}
{media.medium} {media.settings.duration && (', ' + media.settings.duration)}
{media.title} {media.type === 'video' && {PlayIcon} }
))}
) })}
) } } const mapStateToProps = state => ({ sections: state.viewer.sections, }) export default connect(mapStateToProps)(ChecklistContent)