import{a}from"./vendor-CWhr2lg4.js";function d(c){const[s,i]=a.useState({pageIndex:0,pageSize:25}),[n,r]=a.useState([]),[o,l]=a.useState(""),g=a.useMemo(()=>{const t={page:s.pageIndex+1,page_size:s.pageSize};if(o&&(t.search=o),n.length>0){const e=n[0];e&&(t.ordering=e.desc?`-${e.id}`:e.id)}return t},[s,n,o]),p=a.useCallback(t=>{l(t),i(e=>({...e,pageIndex:0}))},[]);return{pagination:s,setPagination:i,sorting:n,setSorting:r,globalFilter:o,setGlobalFilter:p,queryParams:g}}export{d as u};
