content: import React from 'react'
  import Search from './Search' // eslint-disable-line no-unused-vars
  import AppRow from './AppRow' // eslint-disable-line no-unused-vars
  import store from '../services/Store'
  
  export default class AppLaunchpad extends React.Component {
    constructor (props, context) {
      super(props, context)
      this.state = store.getState()
    }
  
    componentDidMount () {
      store.subscribe(() => this.setState(store.getState()))
      store.dispatch({ type: 'SET_QUERY_PARAMS', query: this.props.query })
    }
  
    render () {
      const apps = this.state.apps
      let rows = []
  
      let content = (
        <div id="content">
          {rows}
        </div>
      )
  
      if (this.state.loading) {
        content = (
          <div id="content">
            <div style={{ textAlign: 'center', marginBottom: '30px' }}>
              <span className="throbber-loader">Loading…</span>
            </div>
          </div>
        )
      } else {
        // const appTriples = _.chunk(apps, 120)
        const appTriples = [apps]
        rows = appTriples.map(function (apps, index) {
          return <AppRow apps={apps} key={index} />
        })
        content = (<div id="content">{rows}</div>)
      }
  
      let newSoftwareRequestRow
      newSoftwareRequestRow = (
        <div className="row" style={{ marginBottom: '20px' }}>
          <div className="col-md-12">
            <a className="btn btn-primary btn-xs pull-right" href="http://goo.gl/forms/4mF6MAKueN">Request new software</a>
          </div>
        </div>)
  
      return (
        <div>
          <div id="search" className="jumbotron">
            <Search value={this.state.search} tags={this.state.filterTags} filteredTagIds={this.state.filteredTagIds} />
          </div>
          {newSoftwareRequestRow}
          {content}
        </div>
      )
    }
  }
  