import { UsePaginationQueryResult } from "@/apis/queries/hooks"; import { LoadingProvider } from "@/contexts"; import { ScrollToTop } from "@/utilities"; import { useEffect } from "react"; import PageControl from "./PageControl"; import SimpleTable, { SimpleTableProps } from "./SimpleTable"; type Props = Omit, "data"> & { query: UsePaginationQueryResult; }; export default function QueryPageTable(props: Props) { const { query, ...remain } = props; const { data = { data: [], total: 0 }, paginationStatus: { page, pageCount, totalCount, pageSize, isPageLoading }, controls: { gotoPage }, } = query; useEffect(() => { ScrollToTop(); }, [page]); return ( ); }