content: import React from 'react'
  import { Field } from 'redux-form'
  import QuestionByType from './QuestionByType'
  
  class SurveyPage extends React.Component {
    render () {
      let { fields, meta, showcase, arrayIndex, ...props } = this.props
      let error
  
      if (!showcase && fields.length === 0) {
        error = (
          <div className={`alert alert-${meta.submitFailed ? 'danger' : 'warning'}`}>
            Page is Empty
          </div>
        )
      }
  
      const cantorPairing = (a, b) => 0.5 * (a + b) * (a + b + 1) + b
  
      return (
        <div>
          {error}
          {fields.map((member, index) =>
            <div key={cantorPairing(arrayIndex, index)}>
              <Field name={member}
                showcase={showcase}
                index={index}
                fields={fields}
                component={QuestionByType}
                {...props}
              />
            </div>
          )}
        </div>
      )
    }
  }
  export default SurveyPage
  