import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

type Props = {
  title?: string,
  icon: IconDefinition,
  description: string,
  animation?: string,
}

function Loader(props: Readonly<Props>) {
  return (
    <div className='loader'>
      <FontAwesomeIcon icon={props.icon} className={`loader-icon ${props.animation ?? ''}`} />
      <h2 className='loader-title'>{props.title ?? 'Prosím čekejte...'}</h2>
      <p className='loader-description'>{props.description}</p>
    </div>
  );
}

export default Loader;
