import 'package:core_localization/core_localization.dart';
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';

/// A header widget for the profile setup page showing back button and step count.
class ProfileSetupHeader extends StatelessWidget {
  /// The current step index (0-based).
  final int currentStep;

  /// The total number of steps.
  final int totalSteps;

  /// Callback when the back button is tapped.
  final VoidCallback? onBackTap;

  /// Creates a [ProfileSetupHeader].
  const ProfileSetupHeader({
    super.key,
    required this.currentStep,
    required this.totalSteps,
    this.onBackTap,
  });

  @override
  /// Builds the header UI.
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(
        horizontal: UiConstants.space5,
        vertical: UiConstants.space4,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          if (currentStep > 0 && onBackTap != null)
            GestureDetector(
              onTap: onBackTap,
              child: const Icon(
                UiIcons.chevronLeft,
                size: 20,
                color: UiColors.textSecondary,
              ),
            )
          else
            const SizedBox(width: UiConstants.space6),
          Text(
            t.staff_authentication.profile_setup_page.step_indicator(
              current: currentStep + 1,
              total: totalSteps,
            ),
            style: UiTypography.footnote1r.textSecondary,
          ),
        ],
      ),
    );
  }
}
