import type { Campaign, Encounter } from '@/lib/schemas'; import { Button } from '@/components/ui/Button'; import { cn } from '@/lib/cn'; import { useEncounterAdvisor } from './useEncounterAdvisor'; /** * Contextual encounter-balancing tip. Shows the detected difficulty tendency and, * on demand, a grounded recommendation (AI when configured, deterministic otherwise) * with one-click apply. Renders nothing when there's no tendency to report. */ export function EncounterTipCard({ campaign, encounter }: { campaign: Campaign; encounter: Encounter }) { const { theme, hasMonsters, currentDifficulty, state, suggestion, source, message, canUseLlm, run, apply } = useEncounterAdvisor(campaign, encounter); // Surface when there's a detected tendency, an encounter with monsters to balance, // or an in-progress/ready suggestion. Stay out of the way otherwise. if (!theme && !hasMonsters && state === 'idle') return null; return (
{suggestion.reasoning}
{message}
} {state !== 'ready' && (