/**
 * Created by vison on 16/11/30.
 */
import React from 'react';
import { Col, Row, Icon, Tabs, Collapse } from '../../components/mxa';
import TabPaneHeader from './TabPaneHeader';
import styles from '../styles/views/home.less';

export default class ScheduleList extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      text: `A dog is a type of domesticated animal.
            Known for its loyalty and faithfulness,
            it can be found as a welcome guest in many households across the world.`
    };
  }

  callback = key => {
    console.log(key);
  };

  renderMaskItem = () => {
    const maskList = this.props.dataSource;
    if (maskList && maskList.length > 0) {
      return maskList.map((item, index) => {
        return (
          <Collapse.Panel header={item.title} key={index}>
            <p>aaaaa</p>
          </Collapse.Panel>
        );
      });
    }
    return null;
  };

  renderMaskReminder = () => {
    return (
      <div>
        <Collapse bordered={false} onChange={this.callback}>
          {this.renderMaskItem()}
        </Collapse>
      </div>
    );
  };

  renderDateTime = () => {
    return (
      <h1>2016年12月2日 星期四</h1>
    );
  };

  render() {
    return (
      <div className={styles.scheduleContainer}>
        <Tabs defaultActiveKey="1">
          <Tabs.TabPane
            styles={{ marginRight: -24 }}
            tab={<TabPaneHeader headerText="任务提示" headerIcon="maskRemind" unRead={99} bgColor="#e5550a" />}
            key="1"
          >
            {this.renderMaskReminder()}
          </Tabs.TabPane>
          <Tabs.TabPane tab={<TabPaneHeader headerText="提示页面" headerIcon="notification" unRead={9} bgColor="#0068cd" />} key="2">
            {this.renderMaskReminder()}
          </Tabs.TabPane>
          <Tabs.TabPane tab={<TabPaneHeader headerText="预警页面" headerIcon="warn" unRead={100} bgColor="#0084e0" />} key="3">
            {this.renderMaskReminder()}
          </Tabs.TabPane>
          <Tabs.TabPane tab={<TabPaneHeader headerText="征求意见" headerIcon="advice" unRead={0} bgColor="#00aced" />} key="4">
            {this.renderMaskReminder()}
          </Tabs.TabPane>
          <Tabs.TabPane tab={<TabPaneHeader headerText="重点信息链接" headerIcon="link" unRead={17} bgColor="#009ffd" />} key="5">
            {this.renderMaskReminder()}
          </Tabs.TabPane>
        </Tabs>
      </div>
    );
  }
}
