import { AnimatePresence, motion } from 'framer-motion'; import { Check, CloudUpload, AlertCircle, type LucideIcon } from 'lucide-react'; import { cn } from '@/lib/utils'; interface SaveState { icon: LucideIcon; text: string; cls: string; } const STATES: Record = { saving: { icon: CloudUpload, text: 'Saving…', cls: 'text-muted-foreground border-border/70 bg-muted/40' }, saved: { icon: Check, text: 'Saved', cls: 'text-emerald-600 dark:text-emerald-300 border-emerald-500/30 bg-emerald-500/10' }, error: { icon: AlertCircle, text: 'Save failed', cls: 'text-rose-500 dark:text-rose-300 border-rose-500/35 bg-rose-500/10' }, }; /** * Tiny animated pill that reflects auto-save state. Renders nothing while idle — * the page communicates "changes save automatically" once, statically. */ export function SaveStatus({ status, className }: { status?: string | null; className?: string }) { const state = status ? STATES[status] : undefined; return ( {state && ( {state.text} )} ); }