({ labels, feedback, onRefresh, className }: {
labels: { idle: string; busy: string; done: (time: string) => string };
feedback?: RefreshFeedback; onRefresh: () => void; className?: string;
})
| 71 | * they were; a second press while it runs does nothing. |
| 72 | */ |
| 73 | export function RefreshControl({ labels, feedback, onRefresh, className }: { |
| 74 | labels: { idle: string; busy: string; done: (time: string) => string }; |
| 75 | feedback?: RefreshFeedback; onRefresh: () => void; className?: string; |
| 76 | }): JSX.Element { |
| 77 | const running = feedback?.phase === 'running'; |
| 78 | return <span className="atlas-refresh" data-phase={feedback?.phase}> |
| 79 | <button type="button" className={className} aria-disabled={running || undefined} aria-busy={running || undefined} |
| 80 | onClick={() => { if (!running) onRefresh(); }}>{running ? labels.busy : labels.idle}</button> |
| 81 | <span className="atlas-refresh-status" role="status" data-phase={feedback?.phase}>{refreshStatus(feedback, labels.done)}</span> |
| 82 | </span>; |
| 83 | } |
nothing calls this directly
no test coverage detected