
import React, { Component } from 'react';
import { Button, } from 'antd';
class HeaderForm extends Component {
  confirm(action) {
    action();
   // message.success('Click on Yes');
  }
  
  cancel(e) {
    // console.log(e);
    // message.error('Click on No');
  }
  
  render() {
    const { title , actionBtnName, loading, disabled, isInsideForm } = this.props;
    return (
      <div style={{display: 'flex', 
        justifyContent: 'space-between', 
        alignItems: 'center', 
        borderBottom: '1px solid #E6ECF5', 
        background: '#fff', 
        position: 'fixed', width: '100%', 
        padding: '0px 24px 5px', zIndex: 99,
        marginTop: isInsideForm == true ? '-154px' : '-73px' , marginLeft: '-17px' }}
      >
        <h1 style={{fontSize: '24px'}}>{title}</h1>
          <div style={{display: 'flex', position: 'fixed', right: '24px'}}>
              <div>
                <Button  
                  disabled={disabled}
                  loading={loading} 
                  style={{ 
                    margin: '0 4px', width: '135px', 
                    display: 'block', background: '#E74610', borderColor:'#E74610', 
                    color: '#fff' ,
                    opacity: disabled ? 0.5 : 'initial'
                  }}
                  onClick={this.props.onClick}
                >
              {actionBtnName}
            </Button>
          </div>
        </div>
      </div>
    );
  }
}

export default HeaderForm;