import React, { useState } from 'react';
import PropTypes from 'prop-types';
import useModal from '../../vm-hooks/useModal';
import { Button, Space } from 'antd';
import { VtxGasSecurityCheckModal, VtxThemeProvider } from '@vtx/modals';

const demo2 = props => {
    const [visible, setVisible] = useState(false);
    const [theme, setTheme] = useState('light');
    const showModal = theme => {
        setVisible(true);
        setTheme(theme);
    };
    const handleCancel = () => {
        setVisible(false);
    };
    return (
        <VtxThemeProvider value={{ theme }}>
            <Space>
                <Button type="primary" onClick={() => showModal('light')}>
                    基本模态框
                </Button>
                <Button type="primary" onClick={() => showModal('dark')}>
                    深色的入户安检模态框
                </Button>
                <VtxGasSecurityCheckModal.Modal
                    id="1546786764451258370"
                    onCancel={handleCancel}
                    visible={visible}
                />
            </Space>
        </VtxThemeProvider>
    );
};

export default demo2;
