overleaf/services/web/frontend/js/shared/components/loading-branded.tsx

38 lines
872 B
TypeScript
Raw Normal View History

type LoadingBrandedTypes = {
loadProgress: number // Percentage
label?: string
hasError?: boolean
}
export default function LoadingBranded({
loadProgress,
label,
hasError = false,
}: LoadingBrandedTypes) {
return (
<>
<div className="loading-screen-brand-container">
<div
className="loading-screen-brand"
style={{ height: `${loadProgress}%` }}
/>
</div>
{!hasError && (
<div className="h3 loading-screen-label" aria-live="polite">
{label}
<span className="loading-screen-ellip" aria-hidden="true">
.
</span>
<span className="loading-screen-ellip" aria-hidden="true">
.
</span>
<span className="loading-screen-ellip" aria-hidden="true">
.
</span>
</div>
)}
</>
)
}