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

const Demos = () => {
  const [open, setOpen] = useState(false);
  const [sensors, setSensors] = useState('出水瞬时流量');

  const onOk = () => {
    setOpen(false);
  };

  const onCancel = () => {
    setOpen(false);
  };

  return (
    <>
      <Button
        onClick={() => {
          setOpen(true);
        }}
      >
        打开限制曲线
      </Button>
      <Button
        onClick={() => {
          setSensors('噪声');
        }}
      >
        改变sensors
      </Button>
      <LimitCurve
        open={open}
        onOk={onOk}
        onCancel={onCancel}
        deviceCode={'EGBF00000120'}
        deviceType={'二供泵房'}
        sensors={sensors}
      />
    </>
  );
};

export default Demos;
