importuseDebouncefrom'~/hooks/useDebounce';constisEmptyValue=(value:unknown):boolean=>(Array.isArray(value)&&!value.length)||('string'===typeofvalue&&value==='');constuseSearchValue=<T>(value:T,delay=275):T=>{constdebounced=useDebounce(value,delay);// return empty value immediatelyif(isEmptyValue(value)){returnvalue;}// if debounced value is empty, return non-empty value immediatelyif(isEmptyValue(debounced)){returnvalue;}returndebounced;};exportdefaultuseSearchValue;