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

// src/hooks/table/query/use-attribute-table-query.tsx
var useAttributeTableQuery = ({
  prefix,
  pageSize = 20
}) => {
  const queryObject = useQueryParams(
    ["offset", "q", "order", "created_at", "updated_at", "is_filterable"],
    prefix
  );
  const { offset, q, order, created_at, updated_at, is_filterable } = queryObject;
  const searchParams = {
    limit: pageSize,
    offset: offset ? Number(offset) : 0,
    order,
    created_at: created_at ? JSON.parse(created_at) : void 0,
    updated_at: updated_at ? JSON.parse(updated_at) : void 0,
    is_filterable: is_filterable !== void 0 ? is_filterable === "true" : void 0,
    q,
    fields: "*possible_values,*product_categories"
  };
  return {
    searchParams,
    raw: queryObject
  };
};

export {
  useAttributeTableQuery
};
