loading-branded.tsx 996 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { useTranslation } from 'react-i18next'
  2. type LoadingBrandedTypes = {
  3. loadProgress: number // Percentage
  4. label?: string
  5. error?: string | null
  6. }
  7. export default function LoadingBranded({
  8. loadProgress,
  9. label,
  10. error,
  11. }: LoadingBrandedTypes) {
  12. const { t } = useTranslation()
  13. return (
  14. <div className="loading-screen-brand-container">
  15. <div
  16. className="loading-screen-brand"
  17. style={{ height: `${loadProgress}%` }}
  18. />
  19. {error ? (
  20. <p className="loading-screen-error">{error}</p>
  21. ) : (
  22. <div className="h3 loading-screen-label" aria-live="polite">
  23. {label || t('loading')}
  24. <span className="loading-screen-ellip" aria-hidden="true">
  25. .
  26. </span>
  27. <span className="loading-screen-ellip" aria-hidden="true">
  28. .
  29. </span>
  30. <span className="loading-screen-ellip" aria-hidden="true">
  31. .
  32. </span>
  33. </div>
  34. )}
  35. </div>
  36. )
  37. }