aboutsummaryrefslogtreecommitdiffstats
path: root/components/Splash.js
blob: 93ef3ee38b437017a343822f8bfaab0c9e793c21 (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