/**
 * ResignLead view
 *
 * Generated by coz on 11/5/2016,
 * from a template provided by apeman-asset-templates.
 *
 * @function ResignLeadView
 */
'use strict'

import React, { Component, PropTypes as types } from 'react'
import defineDebug from 'debug'
import {
  ApView, ApViewHeader, ApViewBody
} from 'apeman-react-basic'
import {
  asConnected,
  asView,
  asLocaled,
  asServed,
  forSpin,
  combine
} from '../../wrappers'
import { ResignLeadForm } from '../../fragments'

import { IconClasses } from 'ore-fol-enums'

const { RESIGN_ICON } = IconClasses
const debug = defineDebug('project:view:resign-lead')

/** @lends ResignLeadView */
class ResignLeadView extends Component {
  // --------------------
  // Specs
  // --------------------
  static get propTypes () {
    return {}
  }

  static get defaultProps () {
    return {}
  }

  render () {
    const s = this
    const {
      props,
      l
    } = s
    return (
      <ApView id='resign-lead-view'
              className='view'
              spinning={ props.spinning }
              way={ props.way }
      >
        <ApViewHeader onLeftTap={ null }
                      leftText={ null }
                      leftIcon={ null }
                      titleText={ l('titles.RESIGN') }
                      titleIcon={ RESIGN_ICON }
                      onRightTap={ null }
                      rightIcon={ null }
                      rightText={ null }
        />

        <ApViewBody>
          <ResignLeadForm onSubmit={ s.handleNext }
                          onCancel={ s.handlePop }
          />
        </ApViewBody>
      </ApView>
    )
  }

  // --------------------
  // Lifecycle
  // --------------------

  componentWillMount () {
    debug('willMount')
    const s = this
  }

  componentDidMount () {
    debug('didMount')
    const s = this
  }

  componentWillUnmount () {
    debug('willUnmount')
    const s = this
  }

  // --------------------
  // Handlers
  // --------------------

  handleNext () {
    const s = this
    s.handlePush('ResignReasonView', {})
  }

  // --------------------
  // For redux
  // --------------------
  static mapStateToProps (state, ownProps) {
    return {}
  }

}

export default combine(
  asServed(),
  forSpin(),
  asLocaled(),
  asView(),
  asConnected()
)(ResignLeadView)

