namespace Anubis.Server.Components; internal sealed record MenuItem(string Path, string Label, string Icon, string Title); /// The screens of SPEC 13.6 in the order of the mockups. internal static class Menu { public static readonly MenuItem Overview = new("/", "Panoramica", "grid", "Panoramica"); public static readonly MenuItem Accounts = new("/conti", "Conti e posizioni", "card", "Conti e posizioni"); public static readonly MenuItem Trades = new("/operazioni", "Operazioni", "arrows", "Operazioni"); public static readonly MenuItem Strategies = new("/strategie", "Strategie", "layers", "Strategie"); public static readonly MenuItem News = new("/notizie", "Notizie e mercato", "news", "Notizie e mercato"); public static readonly MenuItem Learning = new("/apprendimento", "Apprendimento", "network", "Apprendimento"); public static readonly MenuItem Risk = new("/rischio", "Rischio", "shield", "Rischio"); public static readonly MenuItem Journal = new("/diario", "Diario e sistema", "list", "Diario e sistema"); public static readonly MenuItem Lab = new("/laboratorio", "Laboratorio", "flask", "Laboratorio"); public static readonly MenuItem Settings = new("/impostazioni", "Impostazioni", "sliders", "Impostazioni"); public static readonly MenuItem More = new("/altro", "Altro", "dots", "Altro"); public static readonly IReadOnlyList> Groups = [ [Overview, Accounts, Trades], [Strategies, News, Learning], [Risk, Journal, Lab, Settings], ]; /// The bottom bar of the phone (SPEC 13.4). public static readonly IReadOnlyList Phone = [ Overview, Accounts with { Label = "Conti" }, Journal with { Label = "Diario" }, Risk, More, ]; public static string Title(string path) => Groups.SelectMany(g => g).Append(More).FirstOrDefault(i => i.Path == "/" ? path == "/" : path.StartsWith(i.Path, StringComparison.Ordinal))?.Title ?? "Anubis"; }