import { getSystemSetting } from "@/lib/db/queries"; import { HOME_CHAT_ANIMATION_CONFIG_KEY, resolvePublicHomeChatAnimationConfig, } from "@/lib/home/home-animation-config"; import { cachedPublicJson } from "@/lib/public-api/performance"; export const dynamic = "force-dynamic"; const FALLBACK_HOME_ANIMATION = { enabled: false, fileName: "", htmlContent: "", updatedAt: null, usesDefaultFallback: false, }; export async function GET() { return cachedPublicJson({ cacheKey: "home-animation", fallbackData: FALLBACK_HOME_ANIMATION, timeoutMs: 1600, load: async () => { const setting = await getSystemSetting({ key: HOME_CHAT_ANIMATION_CONFIG_KEY, }).catch(() => null); return resolvePublicHomeChatAnimationConfig(setting?.value); }, }); }