Open History to see the last commit
1import { useEffect, useRef } from "react";
2
3export function FakeProgressIndicator() {
4 const progressRef = useRef<HTMLDivElement>(null);
5
6 useEffect(() => {
7 /*
8 NOTE: This runs twice, so the progress animation
9 jumps back to the start once locally, but I haven't
10 observed this behavior in production builds.
11 */
12 // Force animation to start only once
13 if (progressRef.current) {
14 progressRef.current.style.animation = "none";
15 progressRef.current.offsetHeight; // Trigger reflow
16 progressRef.current.style.animation = "";
17 }
18 }, []);
19
20 return (
21 <div className="w-full flex flex-col justify-center items-center mt-20 gap-4">
22 <span className="text-muted-foreground text-sm">
23 Setting up the database...
24 </span>
25 <div className="w-[60%] max-w-md">
26 <div className="h-2 bg-skeleton rounded-full overflow-hidden">
27 <div
28 ref={progressRef}
29 className="h-full bg-primary progress-animated"
30 />
31 </div>
32 </div>
33 </div>
34 );
35}