using Endpoint;
using Models;
using ShoopNCook.Pages;

namespace ShoopNCook.Controllers
{
    public class MorePageController
    {

        private readonly IApp app;
        private readonly IEndpoint endpoint;
        private readonly Account account;

        public MorePageController(Account account, IEndpoint endpoint, IApp app)
        {
            this.app = app;
            this.endpoint = endpoint;
            this.account = account;
        }

        public void Logout()
        {
            app.Notifier.Notice("You have been loged out.");
            app.ForceLogin();
        }

        public void GoToMyRecipesPage()
        {
            Shell.Current.Navigation.PushAsync(new MyRecipesPage(account, endpoint.RecipesService, app.Notifier));
        }

        public void GoToProfilePage()
        {
            Shell.Current.Navigation.PushAsync(new ProfilePage(account));
        }
    }
}
