import React__default, { useState, useEffect } from 'react';

const Counting = (props) => {
  const { stop, interval = 1e3, render } = props;
  const [, setState] = useState(true);
  useEffect(() => {
    if (stop)
      return;
    const timer = setInterval(() => {
      setState((state) => !state);
    }, interval);
    return () => {
      clearInterval(timer);
    };
  }, [stop, interval]);
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, render());
};
var Counting$1 = Counting;

export { Counting$1 as default };
