import { useStdout } from "ink";
import { useEffect, useState } from "react";
function classifyWidth(cols) {
  if (cols >= 90) return "wide";
  if (cols >= 60) return "narrow";
  return "tiny";
}
function useShellWidth() {
  const { stdout } = useStdout();
  const [w, setW] = useState(() => classifyWidth(stdout.columns));
  useEffect(() => {
    const onResize = () => setW(classifyWidth(stdout.columns));
    stdout.on("resize", onResize);
    return () => {
      stdout.off("resize", onResize);
    };
  }, [stdout]);
  return w;
}
export {
  classifyWidth,
  useShellWidth
};
//# sourceMappingURL=width.js.map