// frontend/lib/hooks/useProactive.ts — SWR 능동 카드 목록
"use client";
import useSWR from "swr";
import type { ProactiveCard } from "@/lib/types";
import { getProactive } from "@/lib/proactive/api";

export function useProactive() {
  const { data, error, isLoading, mutate } = useSWR<ProactiveCard[]>(
    "/api/proactive",
    () => getProactive(),
    { revalidateOnFocus: false },
  );
  return { data, isLoading, error, refresh: mutate };
}
