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

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

export {
  useOrderTableQuery
};
