import React, { useState } from 'react';
import PropTypes from 'prop-types';
import useModal from '../../vm-hooks/useModal';
import { Button, Space } from 'antd';
import { VtxGasFillingStationModal, 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>
                <VtxGasFillingStationModal.Modal
                    id="1556537202621734914"
                    onCancel={handleCancel}
                    visible={visible}
                />
            </Space>
        </VtxThemeProvider>
    );
};

export default demo2;
