import { useQuery } from "@tanstack/react-query"
import { supabase } from "@/lib/supabase"

export function useQuestions(part: number, limit = 10) {
  return useQuery({
    queryKey: ["questions", part, limit],
    queryFn: async () => {
      const { data, error } = await supabase
        .from("questions")
        .select("*")
        .eq("part", part)
        .limit(limit)
      if (error) throw error
      return data
    },
    enabled: false, // Enabled during feature implementation
  })
}
