"use client"; import { Button } from "@mdxui/primitives/button"; import { ArrowLeft, Moon, Sun } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useTheme } from "next-themes"; import { useScroll } from "./lib/use-scroll"; import { cx } from "./lib/utils"; interface Step { name: string; href: string; } // Base steps that always appear const baseSteps: Step[] = [ { name: "Business function", href: "/demo/onboarding/business-function" }, { name: "Systems to connect", href: "/demo/onboarding/systems-connect" }, { name: "API consumption", href: "/demo/onboarding/api-consumption" }, { name: "Expected scale", href: "/demo/onboarding/expected-scale" }, { name: "Authentication", href: "/demo/onboarding/auth-method" }, { name: "Project name", href: "/demo/onboarding/project-name" }, ]; // Conditional steps that appear based on user selections const conditionalSteps: Step[] = [ { name: "Cloud provider", href: "/demo/onboarding/cloud-provider" }, ]; interface StepProgressProps { steps: Step[]; } function StepProgress({ steps }: StepProgressProps) { const pathname = usePathname(); // Check if we're on a conditional step and build the active steps list const isOnConditionalStep = conditionalSteps.some((step) => pathname.startsWith(step.href), ); const activeSteps = isOnConditionalStep ? [ ...baseSteps.slice(0, 3), // Business function, Systems, API consumption conditionalSteps[0], // AI provider (inserted after API consumption) ...baseSteps.slice(3), // Expected scale, Authentication ] : steps; const currentStepIndex = activeSteps.findIndex((step) => pathname.startsWith(step.href), ); return (
    {activeSteps.map((step, index) => (
  1. {step.name}{" "} {index < currentStepIndex ? "completed" : index === currentStepIndex ? "current" : ""}
  2. ))}
); } function ThemeToggle() { const { theme, setTheme } = useTheme(); return ( ); } interface OnboardingLayoutProps { children: React.ReactNode; } export function OnboardingLayout({ children }: OnboardingLayoutProps) { const scrolled = useScroll(15); return ( <>
{children}
); }