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

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

const debug = defineDebug('project:view:error-invalid')

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

  static get defaultProps () {
    return {}
  }

  render () {
    const s = this
    const {
      props,
      l
    } = s
    return (
      <ApView headerless
              id='error-invalid-view'
              className='view'
              spinning={ props.spinning }
              way={ props.way }
      >
        <ApViewBody>
          <ApDone message={ props.message || l('messages.INVALID_PAGE') }
                  linkHref='/'
                  linkText={ l('links.RETURN_TO_TOP') }/>
        </ApViewBody>
      </ApView>
    )
  }

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

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

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

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

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

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

}

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

