import { useEffect as e, useState as t } from "react";
//#region src/hooks/useDebounce.ts
function n(n, r = 500) {
	let [i, a] = t(n);
	return e(() => {
		if (typeof n == "string") {
			let e = n.length;
			if (e > 0 && e < 3) return;
		}
		let e = setTimeout(() => {
			a(n);
		}, r);
		return () => {
			clearTimeout(e);
		};
	}, [n, r]), i;
}
//#endregion
export { n as useDebounce };
