using CommunityToolkit.Mvvm.DependencyInjection;
using PSCHelpdesk.Plugins.Nextcloud.Services;
using PSCHelpdesk.Plugins.Nextcloud.ViewModels;
using PSCHelpdesk.Plugins.Nextcloud.Views;
using PSCHelpdesk.Shared.Menu;
using PSCHelpdesk.Shared.Plugin;
using PSCHelpdesk.Shared.Service;

namespace PSCHelpdesk.Plugins.Nextcloud;

public class Nextcloud : Contract
{
    public string GetName()
    {
        return "NextcloudPlugin";
    }

    public void Configure()
    {
        var menuService = Ioc.Default.GetRequiredService<IMenuService>();
        var notesTab = new Item()
        {
            Header = "Notes",
            CommandParameter = new NotesViewModel()
        };
        menuService.AddMenuItem(notesTab);
        var settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
        var hetznerSettings = new Shared.Setting.Item()
        {
            Header = "Nextcloud",
            CommandParameter = new NextcloudSettingsViewModel()
        };
        settingsService.AddSetting(hetznerSettings);
    }

    public List<Type> LoadViews()
    {
        return [typeof(NextcloudSettingsView), typeof(NotesView)];
    }
    
}