﻿import React, { Fragment, memo, useState, useEffect, } from 'react';
import Botones from '../../components/UI/botonera/headerBotones.js';
import CajaTextoBusqueda from '../../components/UI/cajaTexto/cajaTextoBusqueda.jsx';
import CajaTexto from '../../components/UI/cajaTexto/cajaTexto.jsx';
import TextArea from '../../components/UI/textArea/textArea.jsx';
import ModalBusquedaEmp from '../../components/UI/modalBusqueda/modalBusquedaFiltro.jsx';

export default function InclusionesInt(props) {

    const columnasEmp = [{ dataField: 'Empleado', text: 'Número', csvText: 'Numero', sort: true }, { dataField: 'NomCompleto2', text: 'Nombre', sort: true }];

    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'>
                            <CajaTextoBusqueda col="6" id="CodigoEmpleado" type="text" label={props.Datos.CodigoEmpleado.attributes.label} value={props.Datos.CodigoEmpleado.value} attributes={props.Datos.CodigoEmpleado.attributes} onChangeInput={props.onChangeInputEmp} onClick={props.handleModalEmp} onKeyPress={props.onKeyPressEmp} onBlur={props.onBlurEmpl} />
                            <CajaTexto col="6" id="NombreEmpleado" type="text" label={props.Datos.NombreEmpleado.attributes.label} value={props.Datos.NombreEmpleado.value} attributes={props.Datos.NombreEmpleado.attributes} onChangeInput={() => { }} />
                        </div>
                        <div className='row'>
                            <TextArea id='Comentario' col='12' value={props.Datos.Comentario.value} label={props.Datos.Comentario.attributes.label} attributes={props.Datos.Comentario.attributes} onChangeInput={props.onChangeInputEmp} rows='3' />
                        </div>
                    </div>
                </div>
            </div>
            <ModalBusquedaEmp
                selectedModal={props.selectModalEmp}
                contentLabel={'selectedBusquedasEmp'}
                datos={props.listaEmpleados}
                id={'Empleado'}
                columnas={columnasEmp}
                striped={false}
                hover={true}
                condensed={false}
                selectRow={props.selectRowEmp}
                onDoubleClick={props.onDoubleClickEmp}
                label={'Lista de Empleados'}
                cerrarModal={props.cerrarModalEmp}
                seleccionModal={props.seleccionModalEmp}
                verLHOC={false}
                nombreCSV={'BusquedaEmpleado'}
            />
        </Fragment>
    )

}