import React from 'react';
import Step0 from '@/components/add-organization/steps/Step0.tsx';
import Step1 from '@/components/add-organization/steps/Step1.tsx';
import Step2 from '@/components/add-organization/steps/Step2.tsx';
import { UseFormReturn } from 'react-hook-form';
import { OrganizationFormData } from '@/types.ts';

interface WizardContentProps {
  currentStep: number;
  form: UseFormReturn<OrganizationFormData>;
  onSmartFill: (text: string) => void;
  onManualFill: () => void;
  isParsing: boolean;
  parseError: Error | null;
  generateDescription: () => void;
  isGenerating: boolean;
}

const WizardContent: React.FC<WizardContentProps> = ({
  currentStep,
  form,
  onSmartFill,
  onManualFill,
  isParsing,
  parseError,
  generateDescription,
  isGenerating,
}) => {
  switch (currentStep) {
    case 1:
      return (
        <Step0
          onSmartFill={onSmartFill}
          onManualFill={onManualFill}
          isParsing={isParsing}
          parseError={parseError}
        />
      );
    case 2:
      return (
        <Step1
          control={form.control}
          errors={form.formState.errors}
          watch={form.watch}
          setValue={form.setValue}
          generateDescription={generateDescription}
          isGenerating={isGenerating}
        />
      );
    case 3:
      return <Step2 control={form.control} errors={form.formState.errors} />;
    default:
      return null;
  }
};

export default WizardContent;
