MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / SaveIndicator

Function SaveIndicator

ui/src/components/SaveIndicator.tsx:3–36  ·  view source on GitHub ↗
({ status, onRetry }: { status: SaveStatus; onRetry?: () => void })

Source from the content-addressed store, hash-verified

1import type { SaveStatus } from '../hooks/useAutoSave'
2
3export function SaveIndicator({ status, onRetry }: { status: SaveStatus; onRetry?: () => void }) {
4 if (status === 'idle') return null
5
6 return (
7 <span className="inline-flex items-center gap-1.5 text-[11px] shrink-0">
8 {status === 'saving' && (
9 <>
10 <span className="w-1.5 h-1.5 rounded-full bg-accent animate-pulse" />
11 <span className="text-text-muted">Saving…</span>
12 </>
13 )}
14 {status === 'saved' && (
15 <>
16 <span className="w-1.5 h-1.5 rounded-full bg-green" />
17 <span className="text-text-muted">Saved</span>
18 </>
19 )}
20 {status === 'error' && (
21 <>
22 <span className="w-1.5 h-1.5 rounded-full bg-red" />
23 <span className="text-red">Save failed</span>
24 {onRetry && (
25 <button
26 onClick={onRetry}
27 className="text-red underline underline-offset-2 hover:text-text ml-0.5"
28 >
29 Retry
30 </button>
31 )}
32 </>
33 )}
34 </span>
35 )
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected