import { AlertTriangle, Check, CloudOff, Eye, RefreshCw } from 'lucide-react' import type { BookRecord } from '@trek/shared' import type { SaveState } from './useBookStore' /** * Whether the book is safe. * * Autosave without a sign of it is a promise you are asking someone to take on * faith, and the moment they do not is the moment they close the tab to check. * So: a tick when it is written, a spinner while it is being written, and — the * one that matters — a real choice when someone else got there first. * * Quiet by design. This sits in the top bar of an editor, and a status that * announces every successful save is a status people learn to stop reading, * which is exactly the wrong habit for the one time it says something else. */ export function SaveIndicator({ state, t, onAcceptTheirs, onKeepMine, onRetry, }: { state: SaveState t: (k: string) => string onAcceptTheirs: (current: BookRecord) => void onKeepMine: (current: BookRecord) => void onRetry: () => void }) { if (state.status === 'conflict') { return (