import type React from 'react'
import { Check, CircleAlert } from 'lucide-react'
export interface WizardStep {
id: string
label: string
shortLabel?: string
valid?: boolean
}
export function WizardShell({
eyebrow,
title,
subtitle,
steps,
activeStep,
onStep,
children,
sidebar,
footer,
}: {
eyebrow: string
title: string
subtitle?: React.ReactNode
steps: WizardStep[]
activeStep: string
onStep: (id: string) => void
children: React.ReactNode
sidebar?: React.ReactNode
footer?: React.ReactNode
}) {
const activeIndex = Math.max(0, steps.findIndex((step) => step.id === activeStep))
return (
{eyebrow}
{title}
{subtitle && {subtitle}
}
{steps.map((step, index) => {
const active = step.id === activeStep
const done = index < activeIndex && step.valid !== false
const invalid = step.valid === false
return (
-
)
})}
{children}
{sidebar && (
)}
{footer}
)
}
export function WizardPanel({
title,
subtitle,
children,
}: {
title: string
subtitle?: React.ReactNode
children: React.ReactNode
}) {
return (
{title}
{subtitle &&
{subtitle}
}
{children}
)
}