aboutsummaryrefslogtreecommitdiffstats
path: root/components/Splash.js
blob: f8072025df8d1aa23abad46f714e25c400a0e064 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import styles from 'styles/Main.module.scss'
import React from 'react'
import useSettings from 'hooks/useSettings'
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {faBan, faSpinner} from '@fortawesome/free-solid-svg-icons'

const Splash = ({type, fixed = false}) => {
  const {t} = useSettings()

  return (
    <div className={`${type === 'connection' ? styles.connection : styles.loader} ${fixed ? styles.fixed : ''}`}>
      <FontAwesomeIcon icon={type === 'connection' ? faBan : faSpinner} />
      <p>{type === 'connection' ? t('no_connection') : t('loading')}</p>
    </div>
  )
}

export default Splash