// frontend/lib/hooks/useNotify.ts — 알림 트리아지/가드/다이제스트/발신자 SWR 훅 "use client"; import useSWR from "swr"; import type { Digest, NotifyGuard, SenderRule, Triage } from "@/lib/types"; import { notifyApi } from "@/lib/notify/api"; export function useNotify() { const { data: triage, error, mutate, } = useSWR("notifications", () => notifyApi.triage(), { revalidateOnFocus: false }); const { data: guard, mutate: mGuard } = useSWR( "notifications/guard", () => notifyApi.guard(), { revalidateOnFocus: false }, ); const { data: digests } = useSWR("notifications/digests", () => notifyApi.digests(), { revalidateOnFocus: false, }); const { data: senders } = useSWR( "notifications/senders", () => notifyApi.senders(), { revalidateOnFocus: false }, ); return { triage, guard, digests, senders, error, mutate, mGuard }; }