/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, { Component } from "react";
import {
  StyleSheet,
  Text,
  View
} from "react-native";

import ScrollRow from "./ScrollRow";

export default class CourseListRow extends Component {
  render() {
    return (
      <View style={styles.courseList}>
        <View style={[styles.padding, styles.title]}>
          <Text style={styles.font}>{this.props.title}</Text>
          <Text style={styles.color}>共{this.props.wareList.length}课</Text>
        </View>
        <View style={{
            flex: 1,
            height: 200,
          }}>
            <ScrollRow itemWidth={106} itemHeight={150} data={this.props.wareList} type={ true } changeUri={ this.props.changeUri }/>
          </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  courseList: {
    width: '100%',
    backgroundColor: '#fff',
    marginTop: 8,
  },
  padding: {
    paddingLeft: 20,
    paddingRight: 20,
  },
  title: {
    display: 'flex',
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
  },
  font: {
    paddingTop: 10,
    paddingBottom: 10,
    fontSize: 18,
    color: 'black',
    fontWeight: 'bold',
  },
  clor: {
    fontSize: 14,
    color: 'black',
  },
});