import {
  useQueryParams
} from "./chunk-THHRRYRS.js";

// src/hooks/table/query/use-payout-table-query.tsx
var usePayoutTableQuery = ({
  prefix,
  pageSize = 20
}) => {
  const queryObject = useQueryParams(
    ["offset", "q", "order", "created_at", "updated_at", "status"],
    prefix
  );
  const { offset, q, order, created_at, updated_at, status } = queryObject;
  const searchParams = {
    limit: pageSize,
    offset: offset ? Number(offset) : 0,
    q,
    order: order ?? "-created_at",
    created_at: created_at ? JSON.parse(created_at) : void 0,
    updated_at: updated_at ? JSON.parse(updated_at) : void 0,
    status: status?.split(",")
  };
  return {
    searchParams,
    raw: queryObject
  };
};

export {
  usePayoutTableQuery
};
