using Avalonia.Controls;
using CommunityToolkit.Mvvm.DependencyInjection;
using Prise.Plugin;
using PSCHelpdesk.Plugins.HetznerServer.Menu;
using PSCHelpdesk.Plugins.HetznerServer.ViewModels;
using PSCHelpdesk.Plugins.HetznerServer.Views;
using PSCHelpdesk.Shared.Menu;
using PSCHelpdesk.Shared.Plugin;
using PSCHelpdesk.Shared.Service;

namespace PSCHelpdesk.Plugins.HetznerServer;

[Plugin(PluginType = typeof(Contract))]
public class HetznerServer : Contract
{
    public string GetName()
    {
        return "HetznerServerPlugin";
    }

    public void addMenu()
    {
        var menuService = Ioc.Default.GetService<IMenuService>();
        var serverTab = new Item()
        {
            Header = "Server",
            ViewModel = typeof(ServerViewModel)
        };
        menuService.AddMenuItem(serverTab);
        //return serverTab;
    }

    public UserControl load()
    {
        return new ServerView();
    }
}