"use client"
import{useEffect as o,useState as p}from"react";function u({pageSize:r,offset:t,onOffsetChange:a}){let[e,i]=p({pageIndex:0,pageSize:r});return o(()=>{i(n=>({...n,pageIndex:Math.floor(t/n.pageSize)}))},[t]),o(()=>{a==null||a(e.pageIndex*e.pageSize)},[e]),{pagination:e,setPagination:i}}export{u as a};
