'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _moment = require('moment');

var _moment2 = _interopRequireDefault(_moment);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*  weak */

class StatusBar extends _react2.default.Component {
  shouldComponentUpdate(nextProps) {
    if (this.props.notebook !== nextProps.notebook || this.props.lastSaved !== nextProps.lastSaved) {
      return true;
    }
    return false;
  }

  render() {
    return _react2.default.createElement(
      'div',
      { className: 'status-bar' },
      _react2.default.createElement(
        'span',
        { className: 'pull-right' },
        this.props.lastSaved ? _react2.default.createElement(
          'p',
          null,
          ' Last saved ',
          (0, _moment2.default)(this.props.lastSaved).fromNow(),
          ' '
        ) : _react2.default.createElement(
          'p',
          null,
          ' Not saved yet '
        )
      ),
      _react2.default.createElement(
        'span',
        { className: 'pull-left' },
        _react2.default.createElement(
          'p',
          null,
          this.props.kernelSpecName,
          ' | ',
          this.props.executionState
        )
      )
    );
  }
}
exports.default = StatusBar;