import React, { memo } from 'react';
import { withRouter } from 'react-router-dom';

import DatePicker from '../../components/UI/dataPicker/dataPicker.jsx';
import CheckBox from '../../components/UI/checkBox/checkBox.jsx';
import FrmBotones from '../../components/UI/botonera/formBotones.jsx'
import Botones from '../../components/UI/botonera/headerBotones';
import TablaFiltro from '../../components/UI/tablaFiltro/tablaFiltroSort.jsx';

import Config from '../../components/Util/constantes.js';

export const rebajoPorTardiasInt = (props) => {
    return (
        <>
            <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">
                            <div className="col-sm-12 col-md-12">
                                <div >
                                    <CheckBox col="4" id='SolicitudPendienteAprobar' attributes={props.filtros.SolicitudPendienteAprobar.attributes} value={props.filtros.SolicitudPendienteAprobar.value} label={props.filtros.SolicitudPendienteAprobar.attributes.label} onChange={props.handleCheckedChange} />
                                    <DatePicker id="Desde" col="3" value={props.filtros.Desde.value} attributes={props.filtros.Desde.attributes} label={props.filtros.Desde.attributes.label} formatDate={Config.dateformat} handleChange={props.onhandleChangeDate} minDate={props.filtros.Desde.attributes.minDate} maxDate={props.filtros.Desde.attributes.maxDate} />
                                    <DatePicker id="Hasta" col="3" value={props.filtros.Hasta.value} attributes={props.filtros.Hasta.attributes} label={props.filtros.Hasta.attributes.label} formatDate={Config.dateformat} handleChange={props.onhandleChangeDate} minDate={props.filtros.Hasta.attributes.minDate} maxDate={props.filtros.Hasta.attributes.maxDate} />
                                    <FrmBotones col="2" attributes={props.filtros.BotonesAE.attributes} botones={props.botonesFiltro} />
                                </div>
                            </div>
                        </div>
                        <div className='row'>
                            <div className="col-sm-12 col-md-12 table table-responsive">
                                <TablaFiltro
                                    columnas={props.columnas}
                                    datos={props.datos}
                                    keyField={'Id'}
                                    modo={props.cellEdit}
                                    rowEvents={props.rowEventsDist}
                                    ingresarDetalle={props.ingresarDetalle}
                                    eliminarDetalle={() => { }}
                                    busqueda={true}
                                    selectRow={props.selectRow}
                                    nombreCSV={props.nombreCSV}
                                />
                            </div>
                        </div>
                        <hr></hr>
                    </div>
                </div>
            </div>

        </>
    );
}

export default withRouter(memo(rebajoPorTardiasInt));
