import React from 'react';
import { Modal } from 'antd';
import PropTypes from 'prop-types';
import { getUrlParam } from '@vtx/utils';
import './style';
const { tenantId, userId, token } = getUrlParam();

const VmCarHistory = props => {
    const { carId, setVisible } = props;
    const url = `${origin}/carHistory/#/index?tenantId=${tenantId}&userId=${userId}&token=${token}&carId=${carId}`;
    return (
        <Modal
            visible={true}
            footer={null}
            onCancel={() => setVisible(false)}
            width={'100%'}
            maximize={false}
            wrapClassName={'modal-view-wrap'}
            bodyStyle={{
                background: 'linear-gradient(0deg, rgba(106, 113, 111, 0.5), rgba(50, 58, 58, 0))',
                color: '#fff',
                height: '768px',
                borderRadius: '10px',
                width: '100%',
                padding: 0,
            }}
        >
            <iframe
                style={{ width: '100%', minHeight: '768px', height: '100%', border: 0 }}
                src={url}
            />
        </Modal>
    );
};

VmCarHistory.propTypes = {
    carId: PropTypes.string,
    setVisible: PropTypes.func,
};

export default VmCarHistory;
