Made sidebar item collection extendable via interface. Refactored settings to system

This commit is contained in:
2025-12-27 23:54:48 +01:00
parent 05c05f1b72
commit ba942b2f8f
7 changed files with 91 additions and 56 deletions

View File

@@ -0,0 +1,49 @@
using LucideBlazor;
using Moonlight.Frontend.Interfaces;
using Moonlight.Frontend.Models;
namespace Moonlight.Frontend.Implementations;
public sealed class SidebarProvider : ISidebarProvider
{
public Task<SidebarItem[]> GetItemsAsync()
{
return Task.FromResult<SidebarItem[]>([
new()
{
Name = "Overview",
IconType = typeof(LayoutDashboardIcon),
Path = "/",
IsExactPath = true,
Order = 0
},
new()
{
Name = "Overview",
IconType = typeof(LayoutDashboardIcon),
Path = "/admin",
IsExactPath = true,
Group = "Admin",
Order = 0
},
new()
{
Name = "Users",
IconType = typeof(UsersRoundIcon),
Path = "/users",
IsExactPath = false,
Group = "Admin",
Order = 10
},
new()
{
Name = "System",
IconType = typeof(SettingsIcon),
Path = "/admin/system",
IsExactPath = false,
Group = "Admin",
Order = 20
}
]);
}
}