import React, { PropTypes } from 'react';
import Const from '../Const';
const InsertModalFooter = ({
  saveBtnText,
  closeBtnText,
  closeBtnContextual,
  saveBtnContextual,
  closeBtnClass,
  saveBtnClass,
  onModalClose,
  onSave
}) =>
  <div>
    <button
      type='button'
      className={ `btn ${closeBtnContextual} ${closeBtnClass}` }
      onClick={ onModalClose }>{ closeBtnText }</button>
    <button
      type='button'
      className={ `btn ${saveBtnContextual} ${saveBtnClass}` }
      onClick={ onSave }>{ saveBtnText }</button>
  </div>;

InsertModalFooter.propTypes = {
  saveBtnText: PropTypes.string,
  closeBtnText: PropTypes.string,
  closeBtnContextual: PropTypes.string,
  saveBtnContextual: PropTypes.string,
  closeBtnClass: PropTypes.string,
  saveBtnClass: PropTypes.string,
  onSave: PropTypes.func,
  onModalClose: PropTypes.func
};
InsertModalFooter.defaultProps = {
  saveBtnText: Const.SAVE_BTN_TEXT,
  closeBtnText: Const.CLOSE_BTN_TEXT,
  closeBtnContextual: 'btn-default',
  saveBtnContextual: 'btn-primary',
  closeBtnClass: '',
  saveBtnClass: '',
  onSave: PropTypes.func,
  onModalClose: PropTypes.func
};

export default InsertModalFooter;

@@ -8,16 +8,27 @@
 React, %7B
+ Component,
  PropTyp
@@ -80,37 +80,357 @@
 t';%0A
-const InsertModalFooter = (%7B%0A
+%0Aclass InsertModalFooter extends Component %7B%0A%0A  handleCloseBtnClick = e =%3E %7B%0A    const %7B beforeClose, onModalClose %7D = this.props;%0A    beforeClose && beforeClose(e);%0A    onModalClose();%0A  %7D%0A%0A  handleSaveBtnClick = e =%3E %7B%0A    const %7B beforeSave, onSave %7D = this.props;%0A    beforeSave && beforeSave(e);%0A    onSave();%0A  %7D%0A%0A  render() %7B%0A    const %7B%0A    
   sa
@@ -432,32 +432,36 @@
    saveBtnText,%0A
+    
   closeBtnText,%0A
@@ -460,16 +460,20 @@
 tnText,%0A
+    
   closeB
@@ -486,16 +486,20 @@
 extual,%0A
+    
   saveBt
@@ -511,16 +511,20 @@
 extual,%0A
+    
   closeB
@@ -532,16 +532,20 @@
 nClass,%0A
+    
   saveBt
@@ -554,41 +554,47 @@
 lass
-,
 %0A  
-onModalClose,%0A  onSave%0A%7D) =%3E%0A
+  %7D = this.props;%0A%0A    return (%0A    
   %3Cd
@@ -597,32 +597,36 @@
   %3Cdiv%3E%0A    
+   
+ 
 %3Cbutton%0A
       type='
@@ -605,32 +605,36 @@
         %3Cbutton%0A
+    
       type='butt
@@ -635,32 +635,36 @@
 ='button'%0A      
+  
+  
 className=%7B %60btn
@@ -704,32 +704,36 @@
 Class%7D%60 %7D%0A      
+    
 onClick=%7B onModa
@@ -726,28 +726,40 @@
 Click=%7B 
-onModalClose
+this.handleCloseBtnClick
  %7D%3E%7B clo
@@ -779,16 +779,20 @@
 button%3E%0A
+    
     %3Cbut
@@ -797,24 +797,28 @@
 utton%0A      
+ 
+   
 type='button
@@ -815,24 +815,28 @@
 pe='button'%0A
+    
       classN
@@ -888,24 +888,28 @@
 s%7D%60 %7D%0A      
+    
 onClick=%7B on
@@ -906,22 +906,39 @@
 Click=%7B 
-onSave
+this.handleSaveBtnClick
  %7D%3E%7B sav
@@ -961,16 +961,20 @@
 on%3E%0A
+    
   %3C/div%3E
 ;%0A%0AI
@@ -969,18 +969,29 @@
   %3C/div%3E
-;
 %0A
+    );%0A  %7D%0A%7D
 %0AInsertM
@@ -1230,16 +1230,77 @@
 string,%0A
+  beforeClose: PropTypes.func,%0A  beforeSave: PropTypes.func,%0A
   onSave
@@ -1580,62 +1580,55 @@
 ,%0A  
-onSave: PropTypes.func,%0A  onModalClose: PropTypes.func
+beforeClose: undefined,%0A  beforeSave: undefined
 %0A%7D;%0A

support before save and close