2022-09-13 09:57:47 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
|
|
|
type LoadingBrandedTypes = {
|
2023-10-16 07:10:43 -04:00
|
|
|
loadProgress: number // Percentage
|
|
|
|
label?: string
|
|
|
|
error?: string | null
|
2022-09-13 09:57:47 -04:00
|
|
|
}
|
|
|
|
|
2023-10-16 07:10:43 -04:00
|
|
|
export default function LoadingBranded({
|
|
|
|
loadProgress,
|
|
|
|
label,
|
|
|
|
error,
|
|
|
|
}: LoadingBrandedTypes) {
|
2022-09-13 09:57:47 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
|
|
<div className="loading-screen-brand-container">
|
|
|
|
<div
|
|
|
|
className="loading-screen-brand"
|
|
|
|
style={{ height: `${loadProgress}%` }}
|
|
|
|
/>
|
2023-10-16 07:10:43 -04:00
|
|
|
{error ? (
|
|
|
|
<p className="loading-screen-error">{error}</p>
|
|
|
|
) : (
|
|
|
|
<div className="h3 loading-screen-label" aria-live="polite">
|
|
|
|
{label || t('loading')}
|
|
|
|
<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>
|
|
|
|
)}
|
2022-09-13 09:57:47 -04:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|