﻿import React, { Fragment, memo, useState, useEffect, } from 'react';
import { Row, Nav, Col, Modal } from "react-bootstrap";
import Botones from '../../components/UI/botonera/headerBotones.js';
import { faReply } from '@fortawesome/free-solid-svg-icons';
import { Tabs, Tab } from "react-bootstrap";
import TabGeneral from './tabGeneral.jsx';
import TabLibroSal from './tabLibroSal.jsx';
import TabLiquidacion  from './liquidacionEmp.jsx'

function modalDetalleEmp(props) {
    const [tabActivo, setTabActivo] = useState('general-tab');

    const handleTabClick = (id) => {
        setTabActivo(id);
    };
    return (
        <Fragment>
            <Modal size="lg" show={props.show} animation={false} onHide={() => { props.cerrarModal(false) }}>
                {/*<Modal.Header closeButton="false">
                    <Modal.Title>{props.titulo}</Modal.Title>
                </Modal.Header>*/}
                <Modal.Body>
                    <Row>
                        <Col>
                            <div className="col-md-12">
                                <div className='row'>
                                    <div className="col-md-6">
                                        <h1>{props.titulo}</h1>
                                    </div>
                                    <div className="col-md-6 text-right">
                                        <div className="acciones">
                                            <Botones
                                                botones={props.botones}
                                            />
                                        </div>
                                    </div>
                                </div>
                                <div className="content">
                                    <div className="content-box">
                                        <div className='row'>
                                            <Tabs
                                                defaultActiveKey={'general-tab'}
                                                activeKey={tabActivo}
                                                id="CallCenterDetalle"
                                                onSelect={handleTabClick}
                                                className="nav-tabs2"
                                            >
                                                <Tab eventKey="general-tab" title={'General'} style={{ opacity: '100' }}>
                                                    <TabGeneral
                                                        id={'general'}
                                                        labelledby={'general-tab"'}
                                                        EmpleadoDet={props.EmpleadoDet}
                                                        foto={props.foto}
                                                    />
                                                </Tab>
                                                <Tab eventKey="libro-tab" title={'Libro de Salarios'} style={{ opacity: '100' }}>
                                                    <TabLibroSal
                                                        id={'libro'}
                                                        labelledby={'libro-tab"'}
                                                        EmpleadoLibroSal={props.EmpleadoLibroSal}
                                                        verLHOCLS={false}
                                                    />
                                                </Tab>
                                                <Tab eventKey="liquidacion-tab" title={'Liquidación'} style={{ opacity: '100' }} disabled= {!props.TabLiq}>
                                                    <TabLiquidacion
                                                        id={'liquidacion'}
                                                        labelledby={'liquidacion-tab"'}
                                                        Datos={props.DatosLiq}
                                                        selectedOptionTipoLiq={props.selectedOptionTipoLiq}
                                                        listaTipoLiq={props.listaTipoLiq}
                                                        onFormato={props.onFormato}
                                                    />
                                                </Tab>
                                            </Tabs>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </Col>
                    </Row>
                </Modal.Body>
                {/* <Modal.Footer>
                    <Botones
                        botones={props.botones}
                    />
                </Modal.Footer>*/}
            </Modal>
        </Fragment>
    );
};
export default modalDetalleEmp;
