import { usePaginationParams } from "@/lib/hooks";
import { PropsWithChildren, createContext } from "react";

export interface IDataTableContextState {}

export const DataTableContext = createContext<IDataTableContextState | null>(null);

export const DataTableProvider = ({ children }: PropsWithChildren) => {
  const [pagination, setPagination] = usePaginationParams();

  return (
    <DataTableContext.Provider
      value={{
        pagination,
        setPagination,
      }}
    >
      {children}
    </DataTableContext.Provider>
  );
};
