File size: 788 Bytes
c768df1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React, { useState, useEffect } from 'react';

const messages = [
  "Reading your resume...",
  "Judging your career choices...",
  "Counting buzzwords...",
  "Checking for Comic Sans...",
  "Evaluating your 'proficient in Microsoft Office'...",
  "Comparing to 10,000 other resumes...",
  "Preparing the roast...",
  "This is going to be good...",
];

export default function Loading() {
  const [msgIndex, setMsgIndex] = useState(0);

  useEffect(() => {
    const interval = setInterval(() => {
      setMsgIndex((i) => (i + 1) % messages.length);
    }, 2500);
    return () => clearInterval(interval);
  }, []);

  return (
    <div className="loading">
      <div className="loading-spinner" />
      <p className="loading-messages">{messages[msgIndex]}</p>
    </div>
  );
}