aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/onboarding/progress-bar.tsx
blob: 8e201eae2719e0986add417ff4f7ff10f5a6f525 (plain) (blame)
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
"use client"

import { motion } from "motion/react"
import { useOnboarding } from "./onboarding-context"

export function OnboardingProgressBar() {
	const { currentVisibleStepNumber, totalSteps } = useOnboarding()

	const progress =
		totalSteps === 0 ? 0 : (currentVisibleStepNumber / totalSteps) * 100

	return (
		<div className="fixed top-0 left-0 right-0 z-50 h-[2px] bg-zinc-200">
			<motion.div
				className="h-full bg-gradient-to-r from-[#06245B] via-[#1A5EA7] to-[#DDF5FF]"
				initial={{ width: "0%" }}
				animate={{ width: `${progress}%` }}
				transition={{
					duration: 0.8,
					ease: "easeInOut",
				}}
			/>
		</div>
	)
}