import React, { useState } from 'react';
import { Button } from 'antd';
import { EmpiricalCurve } from '../index';

const Demos = () => {
  const [visible, setVisible] = useState(false);
  const deviceParams = {
    deviceCode: 'EGBF00000120',
    sensors: '出水瞬时流量',
    deviceType: '二供泵房',
    title: '经验报警曲线',
    visible,
    onClose: () => {
      setVisible(false);
    },
  };
  return (
    <>
      {visible && <EmpiricalCurve {...deviceParams} />}
      <Button onClick={() => setVisible(true)}>打开经验报警曲线</Button>
    </>
  );
};

export default Demos;
