import { useState } from "react";
import { inBrowser } from "../utils";
import useEventListener from "./use-event-listener";
function useWindowSize() {
  const [width, setWidth] = useState(inBrowser ? window.innerWidth : 0);
  const [height, setHeight] = useState(inBrowser ? window.innerHeight : 0);
  const onResize = () => {
    setWidth(window.innerWidth);
    setHeight(window.innerHeight);
  };
  useEventListener("resize", onResize);
  useEventListener("orientationchange", onResize);
  return { width, height };
}
var stdin_default = useWindowSize;
export {
  stdin_default as default
};
