namespace ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared; /// /// One entry in a . An item is either an actionable /// row ( + ) or a visual divider /// ( = true, in which case the other members are /// ignored). Use the factory for dividers. /// public sealed class ContextMenuItem { /// Text shown for the row. public string Label { get; init; } = ""; /// /// Invoked when the row is activated (click / Enter). Async so per-node menu /// actions (delete, redeploy, rename) can await their service calls without an /// exception-swallowing async void; the menu awaits this and re-renders. /// A synchronous handler returns . /// public Func? OnClick { get; init; } /// Optional leading icon — an emoji or single glyph. public string? Icon { get; init; } /// Renders the row greyed-out and non-interactive. public bool Disabled { get; init; } /// When true this entry is a horizontal divider, not a row. public bool IsSeparator { get; init; } /// A horizontal divider between groups of items. public static ContextMenuItem Separator() => new() { IsSeparator = true }; }