import { AnimatePresence, motion } from 'framer-motion'; import { Check, CloudUpload, AlertCircle } from 'lucide-react'; import { cn } from '@/lib/utils'; const STATES = { 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 }) { const state = STATES[status]; return ( {state && ( {state.text} )} ); }