'use client'; import { Star } from 'lucide-react'; import { cn } from '@/lib/cn'; import { toWatchItem, useWatchlist, WATCH_MAX } from '@/lib/watchlist'; /** * Star toggle that adds/removes an entity from the local watchlist (`lib/watchlist.ts`). `aria-pressed` reflects the * state; renders a neutral placeholder before hydration so server and client markup match. Sits next to `CompareButton`. */ export function WatchButton({ e, size = 'md', className, label = 'Watch' }: { e: { slug: string; name: string; entity_type: string; organization?: { name: string } | string | null }; size?: 'sm' | 'md'; className?: string; label?: string }) { const wl = useWatchlist(); const item = toWatchItem(e); const on = wl.ready && wl.has(item.slug); const full = wl.ready && wl.full && !on; return ( ); }