mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
19 lines
611 B
TypeScript
19 lines
611 B
TypeScript
interface LoadingStateProps {
|
|
message?: string;
|
|
/**
|
|
* Suppresses the spinner for the first ~150ms so trivially-fast queries
|
|
* don't flash a spinner on screen. The text shows instantly so there's
|
|
* always something, but the visible spin only kicks in if work is
|
|
* actually slow.
|
|
*/
|
|
delaySpinnerMs?: number;
|
|
}
|
|
|
|
export function LoadingState({ message = 'Loading...' }: LoadingStateProps) {
|
|
return (
|
|
<div className="loading" role="status" aria-live="polite">
|
|
<span className="spinner" aria-hidden="true" />
|
|
<span className="loading-message">{message}</span>
|
|
</div>
|
|
);
|
|
}
|