import ActiveList   from '../../../../panels/ActiveList';
import React        from 'react';
import Toolbar      from '../../../../panels/Toolbar';
import { activateSimulationStep } from '../../../../network/helpers/simulations';

import style            from 'HPCCloudStyle/PageWithMenu.mcss';
import { primaryBreadCrumbs } from '../../../../utils/Constants';

export default React.createClass({

  displayName: 'NWChemSimulation',

  propTypes: {
    module: React.PropTypes.object,
    project: React.PropTypes.object,
    simulation: React.PropTypes.object,
    step: React.PropTypes.string,
    view: React.PropTypes.string,
  },

  contextTypes: {
    router: React.PropTypes.object,
  },

  updateActiveStep(idx, item) {
    const stepName = this.props.module.steps._order[idx];
    activateSimulationStep(this.props.simulation, stepName)
      .then(resp => this.context.router.replace(['/View/Simulation', this.props.simulation._id, stepName].join('/')))
      .catch(err => {
        console.log('Update active error for', stepName);
        console.log(err);
      });
  },

  render() {
    const module = this.props.module;
    const componentClass = module.steps[this.props.step][this.props.view];
    const component = componentClass ? React.createElement(componentClass, this.props) : null;
    const stepIdx = module.steps._order.indexOf(this.props.step);

    const menuList = [];
    module.steps._order.forEach(name => {
      menuList.push({
        name,
        label: module.labels[name].default,
        disabled: this.props.simulation.disabled && (this.props.simulation.disabled.indexOf(name) !== -1),
      });
    });

    return (
      <div className={ style.rootContainer }>
          <Toolbar
            breadcrumb={primaryBreadCrumbs(this.props.project._id, this.props.simulation._id)}
            title={ `${this.props.project.name} / ${this.props.simulation.name}` }
          />
          <div className={ style.container }>
              <ActiveList
                className={ style.menu }
                list={menuList}
                active={stepIdx}
                onActiveChange={this.updateActiveStep}
              />
              <div className={ style.content }>
                  { component }
              </div>
          </div>
      </div>);
  },
});

@@ -89,63 +89,8 @@
 t';%0A
-import Toolbar      from '../../../../panels/Toolbar';%0A
 impo
@@ -235,74 +235,8 @@
 ss';
-%0Aimport %7B primaryBreadCrumbs %7D from '../../../../utils/Constants';
 %0A%0Aex
@@ -1581,218 +1581,8 @@
  %7D%3E%0A
-          %3CToolbar%0A            breadcrumb=%7BprimaryBreadCrumbs(this.props.project._id, this.props.simulation._id)%7D%0A            title=%7B %60$%7Bthis.props.project.name%7D / $%7Bthis.props.simulation.name%7D%60 %7D%0A          /%3E%0A
     

Fix toolbar