|
1 | 1 | 'use client'; |
2 | 2 |
|
3 | | -import { useEffect, useRef } from 'react'; |
| 3 | +import { useEffect, useRef, useState } from 'react'; |
4 | 4 | import { Volume2 } from 'lucide-react'; |
5 | 5 | import { toast } from 'sonner'; |
6 | 6 | import { Button } from '@/components/ui/button'; |
@@ -113,8 +113,36 @@ export function ProvisioningStep({ |
113 | 113 | return <ProvisioningStepView />; |
114 | 114 | } |
115 | 115 |
|
| 116 | +const PROVISIONING_MESSAGES = [ |
| 117 | + 'Reticulating splines...', |
| 118 | + 'Warming up the flux capacitor...', |
| 119 | + 'Convincing the hamsters to run faster...', |
| 120 | + 'Downloading more RAM...', |
| 121 | + 'Generating witty loading messages...', |
| 122 | + 'Consulting the magic 8-ball...', |
| 123 | + 'Untangling the internet tubes...', |
| 124 | + 'Feeding the code monkeys...', |
| 125 | + 'Aligning the bits...', |
| 126 | + 'Compiling the compilers...', |
| 127 | + 'Herding the electrons...', |
| 128 | + 'Calibrating the cloud...', |
| 129 | +]; |
| 130 | + |
116 | 131 | /** Pure visual shell — extracted so Storybook can render it without wiring up mutations. */ |
117 | 132 | export function ProvisioningStepView() { |
| 133 | + const [messageIndex, setMessageIndex] = useState(0); |
| 134 | + const [visible, setVisible] = useState(true); |
| 135 | + |
| 136 | + useEffect(() => { |
| 137 | + const interval = setInterval(() => { |
| 138 | + setVisible(false); |
| 139 | + setTimeout(() => { |
| 140 | + setMessageIndex(i => (i + 1) % PROVISIONING_MESSAGES.length); |
| 141 | + setVisible(true); |
| 142 | + }, 300); |
| 143 | + }, 3500); |
| 144 | + return () => clearInterval(interval); |
| 145 | + }, []); |
118 | 146 | return ( |
119 | 147 | <OnboardingStepView |
120 | 148 | currentStep={4} |
@@ -169,6 +197,14 @@ export function ProvisioningStepView() { |
169 | 197 | </p> |
170 | 198 | </div> |
171 | 199 |
|
| 200 | + {/* Cycling fun message */} |
| 201 | + <p |
| 202 | + className="text-muted-foreground h-5 text-sm italic transition-opacity duration-300" |
| 203 | + style={{ opacity: visible ? 1 : 0 }} |
| 204 | + > |
| 205 | + {PROVISIONING_MESSAGES[messageIndex]} |
| 206 | + </p> |
| 207 | + |
172 | 208 | {/* Sound banner */} |
173 | 209 | <div className="border-border flex w-full items-center gap-3 rounded-lg border p-4"> |
174 | 210 | <Volume2 className="text-muted-foreground h-5 w-5 shrink-0" /> |
|
0 commit comments