﻿import React, { Fragment, memo, useState } from 'react';
import { withRouter } from 'react-router-dom';
import Config from '../../components/Util/constantes.js';
//Componentes
import Botones from '../../components/UI/botonera/headerBotones.js';
import FrmBotones  from '../../components/UI/botonera/formBotones.jsx'
import DatePicker from '../../components/UI/dataPicker/dataPicker.jsx';
import ComboBox from '../../components/UI/comboBox/combobox.jsx';
import TablaFiltro from '../../components/UI/tablaFiltro/tablaFiltroSort.jsx';
import ListaDatos from '../../components/UI/listaDatosBusqueda/index.jsx'
function accionesPersonalInt(props) {
    const estilo = {display: props.detalleVisible };
    return (
        <Fragment>
            <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 box-primary">
                        <div className="row">
                            <ComboBox id="cmbEstado" col="4" attributes={props.Datos.Estado.attributes} value={props.selectedOptionEstado} label={props.Datos.Estado.attributes.label} datos={props.listaEstado} onChange={props.onhandleSelectedOptionEstado} />
                            <ComboBox id="cmbEstadoEmp" col="4" attributes={props.Datos.EstadoEmp.attributes} value={props.selectedOptionEstadoEmp} label={props.Datos.EstadoEmp.attributes.label} datos={props.listaEstadoEmp} onChange={props.onhandleSelectedOptionEstadoEmp} />
                            <ComboBox id="cmbAccionPers" col="4" attributes={props.Datos.AccionPers.attributes} value={props.selectedOptionAccionPers} label={props.Datos.AccionPers.attributes.label} datos={props.listaAccionPers} onChange={props.onhandleSelectedOptionAp} />
                        </div>
                        <div className='row'>
                            <DatePicker id="fecDesde" col="4" value={props.Datos.fecDesde.value} attributes={props.Datos.fecDesde.attributes} label={props.Datos.fecDesde.attributes.label} formatDate={Config.dateformat} handleChange={props.onhandleChangeDate} />
                            <DatePicker id="fecHasta" col="4" value={props.Datos.fecHasta.value} attributes={props.Datos.fecHasta.attributes} label={props.Datos.fecHasta.attributes.label} formatDate={Config.dateformat} handleChange={props.onhandleChangeDate} />
                            <FrmBotones  col="4" attributes={props.Datos.BotonesAE.attributes} botones={props.botonesLista}/>
                        </div>
                        <div className="row">
                            <div className="col-sm-12 col-md-12">
                                <div id="master-tabla" className="table-responsive  col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                    <TablaFiltro
                                        columnas={props.columnasAP}
                                        datos={props.listaGralAP}
                                        keyField={'llave'}
                                        modo={props.cellEditAP}
                                        rowEvents={props.rowEventsAP}
                                        selectRow={props.selectRowAP}
                                        rowStyle={props.rowStyleAP}
                                        verLHOC={props.verLHOCAP}
                                        nombreCSV={"AccionesPersonal"}
                                        busqueda={true}
                                    />
                                </div>
                            </div>
                        </div>
                        <div className="row" style ={estilo}>
                            <div className="col-sm-12 col-md-12">
                                <div id="master-tabla" className="table-responsive  col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                    <ListaDatos
                                        id={'IdDetalle'}
                                        datos={props.listaDetalleAP}
                                        columnas={props.columnasDAP}
                                        striped={false}
                                        hover={true}
                                        condensed={false}
                                        selectRow={props.selectRowDAP}
                                        onDoubleClick={null}
                                        borrar={false}
                                        busquedasExp={"none"}
                                        verLHOC={props.verLHOCAPD}
                                        nombreCSV={"AccionesPersonalDetalle"}
                                    />                                                                       
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </Fragment>
    );
};
export default accionesPersonalInt;