"use client";
import { useCallback } from "react";
import { useStigmer } from "../hooks";
import { useResourceList } from "../search";
/**
 * Data hook that fetches a paginated list of skills for the Library.
 *
 * Wraps `stigmer.skill.list()` with pagination, scope filtering,
 * and text search. All parameters are externally controlled — the
 * consumer manages page state, query debouncing, and scope toggling.
 *
 * For picker/type-ahead search with internal debouncing and query
 * state management, use {@link useSkillSearch} instead.
 *
 * Pass `null` as `org` to skip fetching (stable no-op).
 *
 * @example
 * ```tsx
 * const { skills, totalCount, isLoading } = useSkillList("acme", {
 *   page: 1,
 *   pageSize: 20,
 *   scope: "org",
 * });
 * ```
 *
 * @example
 * ```tsx
 * // Show all skills including public/platform ones
 * const { skills } = useSkillList("acme", { scope: "all" });
 * ```
 */
export function useSkillList(org, options) {
    const stigmer = useStigmer();
    const listFn = useCallback((params) => stigmer.skill.list(params), [stigmer]);
    const { entries, totalCount, totalPages, currentPage, isLoading, error, refetch } = useResourceList(listFn, org, options);
    return { skills: entries, totalCount, totalPages, currentPage, isLoading, error, refetch };
}
//# sourceMappingURL=useSkillList.js.map