import React from 'react';
import Modal from 'react-modal';
import TablaFiltro from '../../../components/UI/tablaFiltroShort/tablaFiltroShort.jsx';
import ListaDatos from '../listaDatosBusqueda/index.jsx';

class modalDetalleCarga extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        const { selectedModal, contentLabel, listaFiltro, columnas, keyRow, label } = this.props;
        const customStyles = {
            content: {
                position: 'fixed',
                position: 'absolute',
                top: '25%',
                left: '15%',
                right: '15%',
                bottom: '25%',
                //top: '50%',
                //left: '50%',
                //right: 'auto',
                with: '70%',
                height: '67%',
                //bottom: 'auto',
                //marginRight: '-50%',
                //transform: 'translate(-50%, -50%)',
                padding: '5px'
            },
            overlay: {
                backgroundColor: 'rgba(0, 0, 0, 0.75)',
                zIndex: 1500,
            },
        };
        return (
            <Modal
                isOpen={selectedModal}
                contentLabel={contentLabel}
                style={customStyles}
                ariaHideApp={false}
            >
                <div className="">
                    <div className="">
                        <div className="modal-header">
                            <button type="button" className="close" data-dismiss="modal" aria-label="Close" onClick={this.props.cerrarModal}>
                                <span aria-hidden="true">&times;</span>
                            </button>
                            <h2 className="modal-title" id="exampleModalLabel">{label}</h2>
                        </div>
                        <div className="modal-body">
                            <div className="row">
                                <div className="col-md-12">
                                    <div className="">
                                        <div className="">
                                            <ListaDatos
                                                id={this.props.id}
                                                datos={listaFiltro}
                                                columnas={columnas}
                                                striped={false}
                                                hover={true}
                                                condensed={false}
                                                selectRow={this.props.selectRow}
                                                verLHOC={this.props.verLHOC}
                                                nombreCSV={this.props.nombreCSV}
                                            />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div className="modal-footer">
                            <button type="button" className="btn btn-secondary" data-dismiss="modal" onClick={this.props.cerrarModal}>Cerrar</button>
                        </div>
                    </div>
                </div>
            </Modal>
        )

    }
}
export default modalDetalleCarga;
