43 lines
1.7 KiB
C#
43 lines
1.7 KiB
C#
using MudBlazor;
|
|
|
|
namespace DeepDrftPublic.Client.Layout;
|
|
|
|
public class PageRoute
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Route { get; set; } = string.Empty;
|
|
public string? Icon { get; set; } = null;
|
|
|
|
// Optional one-level fan-out. A node with children is a dual-role node: its own Route is a
|
|
// real destination (desktop click / mobile tap navigate to it), and Children render as a
|
|
// hover dropdown on desktop and an indented sub-list on mobile. Depth is capped at one level
|
|
// by convention — children are not themselves expected to carry children.
|
|
public IReadOnlyList<PageRoute> Children { get; set; } = [];
|
|
|
|
public bool HasChildren => Children.Count > 0;
|
|
}
|
|
|
|
public static class Pages
|
|
{
|
|
public static readonly List<PageRoute> MenuPages =
|
|
[
|
|
new()
|
|
{
|
|
Name = "Archive", Route = "/archive", Icon = Icons.Material.Filled.Inventory2,
|
|
Children =
|
|
[
|
|
new() { Name = "Cuts", Route = "/cuts", Icon = Icons.Material.Filled.Album },
|
|
new() { Name = "Sessions", Route = "/sessions", Icon = Icons.Material.Filled.Piano },
|
|
new() { Name = "Mixes", Route = "/mixes", Icon = Icons.Material.Filled.GraphicEq },
|
|
],
|
|
},
|
|
new() { Name = "Tracks", Route = "/tracks", Icon = Icons.Material.Filled.MusicNote },
|
|
new() { Name = "Genres", Route = "/genres", Icon = Icons.Material.Filled.Category },
|
|
];
|
|
|
|
public static readonly List<PageRoute> AllPages =
|
|
new List<PageRoute>
|
|
{
|
|
new() { Name = "Home", Route = "/", Icon = Icons.Material.Filled.Home }
|
|
}.Concat(MenuPages).ToList();
|
|
} |