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

export default demo2;
