/**
 * Shared types for the Wizard component family. Reconstructed from
 * consumer usages (WizardProvider, useWizard, WizardDialogLayout,
 * WizardNavigationFooter) after the original file was lost.
 */

import type { ComponentType, ReactNode } from 'react'

/**
 * The shape surfaced by `useWizard()` to step components.
 * Generic `T` is the caller's wizard-data object.
 */
export interface WizardContextValue<T extends Record<string, unknown> = Record<string, unknown>> {
  currentStepIndex: number
  totalSteps: number
  wizardData: T
  setWizardData: (updater: (prev: T) => T) => void
  updateWizardData: (updates: Partial<T>) => void
  goNext: () => void
  goBack: () => void
  goToStep: (index: number) => void
  cancel: () => void
  title?: string
  showStepCounter: boolean
}

/** A step component rendered inside the wizard provider. */
export type WizardStepComponent = ComponentType<Record<string, never>>

/** Props accepted by `<WizardProvider>`. */
export interface WizardProviderProps<T extends Record<string, unknown> = Record<string, unknown>> {
  steps: WizardStepComponent[]
  initialData?: T
  onComplete: (data: T) => void | Promise<void>
  onCancel?: () => void
  children?: ReactNode
  title?: string
  showStepCounter?: boolean
}
