You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
456 B
TypeScript
15 lines
456 B
TypeScript
// 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 };
|
|
}
|