var React = require('react');
var connect = require('react-redux').connect;
var DesktopAppList = require('./desktop-app-list.jsx');
var actions = require('../../actions');

var EditView = React.createClass({

  componentDidMount: function() {
    this.props.dispatch(actions.edit.loadDesktopApps());
  },

  render: function() {

    return (
      <div className="edit">
        <DesktopAppList desktopApps={this.props.desktopApps} />
      </div>
    );

  }

});

function select(state) {
  return {
    desktopApps: state.desktopApps
  };
}

module.exports = connect(select)(EditView);
