"use client"; import { useHealth } from "@/lib/use-health"; import { openSettings } from "@/lib/ui-events"; import { Button } from "@/components/ui"; /** * Tells the user when they need to add (or fix) their own Ollama API key. * Renders nothing in local-daemon / server-key setups. */ export function ApiKeyBanner() { const { health, loading } = useHealth(); if (!health || loading) return null; if (health.authMode !== "user-key") return null; const rejected = health.keyAccepted === false; if (!health.needsKey && !rejected) return null; return (
🔑

{rejected ? "Your Ollama API key was rejected." : "Add your Ollama API key to generate decks."} {" "} Create one at{" "} ollama.com/settings/keys {" "} and paste it in settings. It stays in this browser — the server never stores it.

); }