'use client'; import { Fragment, useCallback, useEffect, useRef, useState } from 'react'; import { ArrowLeft, ArrowRight, Gauge } from 'lucide-react'; import Image from 'next/image'; import * as Badge from '@/components/ui/badge'; import { cn } from '@/utils/cn'; const steps = [ { title: 'Smarter tools, higher sales.', description: 'Use performance insights to improve every campaign and close deals faster.', }, { title: 'Connect every channel.', description: 'Bring all your campaigns together and manage them from a single dashboard.', }, { title: 'Scale with confidence.', description: 'Automate routine work so your team can focus on what drives growth.', }, ]; const STEP_DURATION = 5000; const FADE_DURATION = 300; export default function CampaignGrowthProgressWorkflow() { const [activeStep, setActiveStep] = useState(0); const [runId, setRunId] = useState(0); const [isFading, setIsFading] = useState(false); const stepTimer = useRef | null>(null); const fadeTimer = useRef | null>(null); const goTo = useCallback((nextStep: number) => { if (stepTimer.current) clearTimeout(stepTimer.current); if (fadeTimer.current) clearTimeout(fadeTimer.current); setIsFading(true); fadeTimer.current = setTimeout(() => { setActiveStep((nextStep + steps.length) % steps.length); setRunId((currentRun) => currentRun + 1); setIsFading(false); }, FADE_DURATION); }, []); useEffect(() => { stepTimer.current = setTimeout(() => { goTo(activeStep + 1); }, STEP_DURATION); return () => { if (stepTimer.current) clearTimeout(stepTimer.current); if (fadeTimer.current) clearTimeout(fadeTimer.current); }; }, [activeStep, goTo, runId]); const step = steps[activeStep]; const stepNumber = String(activeStep + 1).padStart(2, '0'); return (
How it works?

Launch quick, grow your revenue

{steps.map((currentStep, index) => ( {index > 0 && (
)}
{index < activeStep && (
)} {index === activeStep && (
)}
))}
{stepNumber}

{step.title}

{step.description}

How it works How it works

Launch your first campaign in minutes and start turning insights into sales.
Simple setup, fast results.

); }