import { type ReactNode, createContext, useContext } from 'react' import { type LucideIcon } from 'lucide-react' import { cn } from '@repo/ui/lib/utils' type StepContextValue = { activeIndex: number } const StepContext = createContext(null) function useStep() { const ctx = useContext(StepContext) if (!ctx) { throw new Error('StepItem must be used inside ') } return ctx } export function Step({ children, className, activeIndex }: { children: ReactNode className?: string activeIndex: number }) { return (
    {children}
) } export function StepSeparator() { return (
) } export function StepItem({ children, icon: Icon, index }: { children: ReactNode icon: LucideIcon index: number }) { const { activeIndex } = useStep() const active = index === activeIndex return (
  • {children}
  • ) }