import { forwardRef, type HTMLAttributes, type ReactNode } from 'react' import { cn } from '@/lib/utils' export interface FormPageStep { label: string status: 'complete' | 'current' | 'upcoming' } export interface FormPageProps extends HTMLAttributes { /** PageHeader or custom header section */ header?: ReactNode /** Action bar above the form content (e.g. dropdowns, buttons) */ actions?: ReactNode /** Vertical stepper steps — renders a progress indicator alongside the form */ steps?: FormPageStep[] /** Form content area */ children: ReactNode } const StepIndicator = ({ step, index }: { step: FormPageStep; index: number }) => { const base = 'flex size-8 shrink-0 items-center justify-center rounded-full text-small font-bold' const styles = { complete: 'bg-success text-white', current: 'bg-info text-white', upcoming: 'bg-grey-04 text-text-secondary', } return ( {step.status === 'complete' ? ( ) : ( index + 1 )} {step.label} ) } export const FormPage = forwardRef( ({ header, actions, steps, className, children, ...props }, ref) => { return ( {header} {actions && ( {actions} )} {steps ? ( {steps.map((step, i) => ( ))} {children} ) : ( children )} ) }, ) FormPage.displayName = 'FormPage'