import 'package:flutter/material.dart';
import 'package:sigap/src/shared/widgets/indicators/step_indicator/styles/numbered_step_indicator.dart';
import 'package:sigap/src/shared/widgets/indicators/step_indicator/styles/rounded_step_indicator.dart';
import 'package:sigap/src/shared/widgets/indicators/step_indicator/styles/standard_step_indicator.dart';
import 'package:sigap/src/utils/helpers/helper_functions.dart';

enum StepIndicatorStyle {
  standard, // Original style with improvements
  rounded, // Rounded connector lines
  numbered, // Numbered steps with different styling
}

class StepIndicator extends StatelessWidget {
  final int currentStep;
  final int totalSteps;
  final List<String> stepTitles;
  final Function(int) onStepTapped;
  final StepIndicatorStyle style;

  const StepIndicator({
    super.key,
    required this.currentStep,
    required this.totalSteps,
    required this.stepTitles,
    required this.onStepTapped,
    this.style = StepIndicatorStyle.standard,
  });

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final isDark = THelperFunctions.isDarkMode(context);

    // Choose the appropriate style
    switch (style) {
      case StepIndicatorStyle.rounded:
        return RoundedStepIndicator(
          currentStep: currentStep,
          totalSteps: totalSteps,
          stepTitles: stepTitles,
          onStepTapped: onStepTapped,
          theme: theme,
          isDark: isDark,
        );
      case StepIndicatorStyle.numbered:
        return NumberedStepIndicator(
          currentStep: currentStep,
          totalSteps: totalSteps,
          stepTitles: stepTitles,
          onStepTapped: onStepTapped,
          theme: theme,
          isDark: isDark,
        );
      case StepIndicatorStyle.standard:
      default:
        return StandardStepIndicator(
          currentStep: currentStep,
          totalSteps: totalSteps,
          stepTitles: stepTitles,
          onStepTapped: onStepTapped,
          theme: theme,
          isDark: isDark,
        );
    }
  }
}
