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", "status", "created_at", "updated_at", "order"],
    prefix
  );
  const { offset, status, created_at, updated_at, q, order } = queryObject;
  const searchParams = {
    limit: pageSize,
    offset: offset ? Number(offset) : 0,
    status: status?.split(","),
    created_at: created_at ? JSON.parse(created_at) : void 0,
    updated_at: updated_at ? JSON.parse(updated_at) : void 0,
    order: order ? order : "-created_at",
    q
  };
  return {
    searchParams,
    raw: queryObject
  };
};

export {
  usePayoutTableQuery
};
