using LSFE.MobApp.Pages.Admin;
using LSFE.MobApp.Pages.Attendance;
using LSFE.MobApp.Pages.Authentication;
using LSFE.MobApp.Pages.CoveragePlan;

namespace LSFE.MobApp
{
    public partial class AppShell : Shell
    {
        private readonly Services.INavigationService _navigationService;
        public AppShell(Services.INavigationService navigationService)
        {
            InitializeComponent();
            _navigationService = navigationService;

            // Register routes
            Routing.RegisterRoute(nameof(LoginPage), typeof(LoginPage));
            Routing.RegisterRoute(nameof(ForgotPasswordPage), typeof(ForgotPasswordPage));
            Routing.RegisterRoute(nameof(DeviceRegistrationPage), typeof(DeviceRegistrationPage));
            Routing.RegisterRoute(nameof(AddEditDoctorPage), typeof(AddEditDoctorPage));
            Routing.RegisterRoute(nameof(ViewDoctorPage), typeof(ViewDoctorPage));
            Routing.RegisterRoute(nameof(MarketProductPage), typeof(MarketProductPage));
            Routing.RegisterRoute(nameof(DoctorSignaturePage), typeof(DoctorSignaturePage));
            Routing.RegisterRoute(nameof(ActualCoveragePage), typeof(ActualCoveragePage));
            Routing.RegisterRoute(nameof(AttendancePage), typeof(AttendancePage));
        }
        private void OnCloseFlyout(object sender, EventArgs e)
        {
            Shell.Current.FlyoutIsPresented = false;
            _navigationService.NavigateToLoginPageAsync();
        }
    }
}