import React, { useState } from 'react';
import PropTypes from 'prop-types';
import useModal from '../../vm-hooks/useModal';
import { Button, Space } from 'antd';
import { VtxGasAlarmModal, 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>
                <VtxGasAlarmModal.Modal
                    onCancel={handleCancel}
                    visible={visible}
                    info={{
                        equipmentName: '阀门井测试ljy',
                        equipmentAddress:
                            '山东省东营市广饶县广浩路乐安大厦内,广饶县人民政府附近27米',
                        equipmentCodeWithId: 'GASHT123123123',
                        divisionId: '79830cb6aada4303a64c3835a5e2bf23',
                        divisionName: '广饶街道',
                        manageUnitId: '09d5218000474bcc8900c03adf3a02f7',
                        manageUnitName: '燃气办',
                        location: {
                            shapeType: 'point',
                            coordinateType: 'wgs84',
                            lngLats: '118.41358995505078,37.05359070406724',
                        },
                        equipmentType: 'fmj',
                        equipmentTypeValue: '阀门井',
                        status: 'WCL',
                        statusStr: '未处理',
                        alarmStartTime: '2022-09-08 05:25:12',
                        alarmEndTime: null,
                        gasConcentration: 0,
                        threshold: 0,
                        position: 0,
                        methaneConcentration: 0,
                        temperature: 0,
                        pressure: 0,
                    }}
                />
            </Space>
        </VtxThemeProvider>
    );
};

export default demo2;
