import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_domain/krow_domain.dart';

/// Extension on [IModularNavigator] providing typed navigation helpers
/// for the Staff Home feature (worker home screen).
///
/// Keep routes as small wrappers around `pushNamed` / `navigate` so callers
/// don't need to rely on literal paths throughout the codebase.
extension HomeNavigator on IModularNavigator {
  /// Navigates to the worker profile page.
  void pushWorkerProfile() {
    pushNamed('/worker-profile');
  }

  /// Navigates to the availability page.
  void pushAvailability() {
    pushNamed('/worker-main/availability');
  }

  /// Navigates to the messages page.
  void pushMessages() {
    pushNamed('/messages');
  }

  /// Navigates to the payments page.
  void navigateToPayments() {
    navigate('/worker-main/payments');
  }

  /// Navigates to the shifts listing.
  /// Optionally provide a [tab] query param (e.g. `find`).
  void pushShifts({String? tab}) {
    if (tab == null) {
      pushNamed('/shifts');
    } else {
      pushNamed('/shifts?tab=$tab');
    }
  }

  /// Navigates to the settings page.
  void pushSettings() {
    pushNamed('/settings');
  }

  /// Navigates to the shift details page for the given [shift].
  void pushShiftDetails(Shift shift) {
    pushNamed('/worker-main/shift-details/${shift.id}', arguments: shift);
  }
}
