'use client'; import { Fragment, useEffect, useRef, useState } from 'react'; import { CircleCheck, Gauge, Plus } from 'lucide-react'; import Image from 'next/image'; import * as Badge from '@/components/ui/badge'; import { cn } from '@/utils/cn'; const steps = [ { title: 'Outline your offer', description: 'Set your main product or service', image: 'https://alignui.com/images/blocks/hiw-6-image-1.png', darkImage: 'https://alignui.com/images/blocks/hiw-6-image-1-dark.png', }, { title: 'Add your creatives', description: 'Include visuals to attract attention', image: 'https://alignui.com/images/blocks/hiw-6-image-1.png', darkImage: 'https://alignui.com/images/blocks/hiw-6-image-1-dark.png', }, { title: 'Launch your campaigns', description: 'Start marketing to reach buyers', image: 'https://alignui.com/images/blocks/hiw-6-image-1.png', darkImage: 'https://alignui.com/images/blocks/hiw-6-image-1-dark.png', }, ]; const STEP_DURATION = 5000; const FADE_DURATION = 300; export default function OfferToCampaignWorkflow() { const [activeStep, setActiveStep] = useState(0); const [isFading, setIsFading] = useState(false); const timeoutRef = useRef | null>(null); useEffect(() => { const interval = setInterval(() => { setIsFading(true); timeoutRef.current = setTimeout(() => { setActiveStep((previousStep) => (previousStep + 1) % steps.length); setIsFading(false); }, FADE_DURATION); }, STEP_DURATION); return () => { clearInterval(interval); if (timeoutRef.current) clearTimeout(timeoutRef.current); }; }, []); const step = steps[activeStep]; return (
How it works?

Increase reach, optimize your sales

List offers in seconds, track campaigns, and keep your team{' '}
focused on growth.

{steps.map((currentStep, index) => { const isCompleted = index < activeStep; const isActive = index === activeStep; const isUpcoming = index > activeStep; const stepNumber = String(index + 1).padStart(2, '0'); return ( {index > 0 && (
)}
{isCompleted ? (
) : isActive ? (
{stepNumber}
) : (
{stepNumber}
)}

{currentStep.title}

{currentStep.description}

{isActive && (

Create your profile and align with your sales team in minutes.

Step illustration Step illustration
)} ); })}

Create your profile and align with your sales team in minutes.

Step illustration Step illustration
); }