<commit_before>import _ from 'lodash';
import React from 'react';

import ProgressButton from '../progressButton';
import Overlay from '../overlay';
import { connectRedux } from '../../helpers/decorators';


// var RestoreOverlay = React.createClass({
//   getInitialState: function() {
//     return {
//       filePath: null,
//     }
//   },

//   render: function() {
//     let cancelBtn = null;

//     cancelBtn = (
//       <Button onClick={this.hide}>Cancel</Button>
//     );
    
//     return (
//       <Overlay ref="overlay">
//         <div className="restore-backup-dialog">
//           <div className="buttons">
//             <MakeBackupProgressPopup {...this.props}>
//               <Button>Begin</Button>
//             </MakeBackupProgressPopup>
            
//           </div>
//         </div>
//       </Overlay>
//     );
//   },

//   show: function(filePath) {
//     this.setState({
//       filePath: filePath
//     });

//     this.refs.overlay.show();
//   },

//   hide: function() {
//     this.refs.overlay.hide();
//   },
// });




var Component = React.createClass({
  render: function() {
    let { diary } = this.props.data;
    let { diaryMgr } = diary;

    let btnAttrs = {
      defaultProgressMsg: 'Restoring backup...',
      checkVar: diary.restoringBackup,
      onClick: this._restoreBackup,
    };

    return (
      <div className="restore-file">
        <h2>Restore</h2>
        <ProgressButton {...btnAttrs}>Restore from backup</ProgressButton>
      </div>
    );
  },

  _restoreBackup: function() {
    this.props.actions.restoreBackup();
  },

});


module.exports = connectRedux([
  'restoreBackup',
])(Component);
<commit_msg>work towards extr restore func<commit_after>import _ from 'lodash';
import React from 'react';

import ProgressButton from '../progressButton';
import Overlay from '../overlay';
import { connectRedux } from '../../helpers/decorators';


// var RestoreOverlay = React.createClass({
//   getInitialState: function() {
//     return {
//       filePath: null,
//     }
//   },

//   render: function() {
//     let cancelBtn = null;

//     cancelBtn = (
//       <Button onClick={this.hide}>Cancel</Button>
//     );
    
//     return (
//       <Overlay ref="overlay">
//         <div className="restore-backup-dialog">
//           <div className="buttons">
//             <MakeBackupProgressPopup {...this.props}>
//               <Button>Begin</Button>
//             </MakeBackupProgressPopup>
            
//           </div>
//         </div>
//       </Overlay>
//     );
//   },

//   show: function(filePath) {
//     this.setState({
//       filePath: filePath
//     });

//     this.refs.overlay.show();
//   },

//   hide: function() {
//     this.refs.overlay.hide();
//   },
// });




var Component = React.createClass({
  render: function() {
    let { diary } = this.props.data;
    let { diaryMgr } = diary;

    let btnAttrs = {
      defaultProgressMsg: 'Restoring backup...',
      checkVar: diary.restoringBackup,
      onClick: this._restoreBackup,
    };

    return (
      <div className="restore-file">
        <h2>Restore</h2>
        <ProgressButton {...btnAttrs}>Restore from backup</ProgressButton>
        {this._buildRestoreFromOldButton()}
      </div>
    );
  },


  _buildRestoreFromOldButton: function() {
    let { diary } = this.props.data;
    let { diaryMgr } = diary;

    let btnAttrs = {
      defaultProgressMsg: 'Restoring from old diary...',
      checkVar: diary.restoringBackup,
      onClick: this._restoreFromOldVersionDiary,
    };

    return (
      <ProgressButton {...btnAttrs}>Restore from v1.x diary</ProgressButton>
    );
  },

  _restoreBackup: function() {
    this.props.actions.restoreBackup();
  },

  _restoreFromOldVersionDiary: function() {
    
  },

});


module.exports = connectRedux([
  'restoreBackup',
])(Component);

{'fraction_non_alphanumeric': 0.17151686840072108, 'fraction_numerical': 0.0012876641771825909, 'mean_word_length': 2.0462745098039217, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4143285', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1196, 'n_words': 220}