"use client";
import { useCallback } from "react";
import { useStigmer } from "../hooks";
import { useResourceCount } from "../search";
/**
 * Data hook that fetches the total count of workflows.
 *
 * Issues a minimal `stigmer.workflow.list()` call to retrieve only the
 * total count — no workflow entries are returned or stored. Useful for
 * summary cards, badges, and dashboard widgets.
 *
 * For the full paginated workflow list, use {@link useWorkflowList} instead.
 *
 * Pass `null` as `org` to skip fetching (stable no-op).
 *
 * @example
 * ```tsx
 * const { count, isLoading } = useWorkflowCount("acme");
 * ```
 */
export function useWorkflowCount(org, options) {
    const stigmer = useStigmer();
    const listFn = useCallback((params) => stigmer.workflow.list(params), [stigmer]);
    return useResourceCount(listFn, org, options);
}
//# sourceMappingURL=useWorkflowCount.js.map