import { ReactComponent as Spinner } from './spinner.svg';
import './spinner.css';

type LoaderProps = { content?: string };

function Loader({ content = DEFAULT_LOADER_CONTENT }: LoaderProps) {
  return (
    <div
      data-testid='loader'
      className='flex h-screen flex-col items-center justify-center text-center'
    >
      <Spinner width='70' className='spinner' />
      <div className='mt-5'>{content}</div>
    </div>
  );
}

export const DEFAULT_LOADER_CONTENT = 'لطفا منتظر بمانید.';

export default Loader;
