"use client";
import { useQuery } from "@tanstack/react-query";
import { readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
function useFeatureFlagString(options) {
  const query = useQuery({
    queryKey: ["featureToggles", "check", "string", options?.id],
    queryFn: async () => {
      const params = new URLSearchParams({
        identifier: options.id
      });
      const result = await readApiResultOrThrow(
        `/api/feature_toggles/check/string?${params.toString()}`,
        void 0,
        { errorMessage: "Failed to check feature flag." }
      );
      return result;
    },
    enabled: !!options.id
  });
  const value = query.data?.ok ? query.data.value : null;
  const isLoading = query.isLoading;
  return {
    value,
    isLoading
  };
}
export {
  useFeatureFlagString
};
//# sourceMappingURL=useFeatureFlagString.js.map
