using Microsoft.AspNetCore.Components; using ZB.MOM.WW.ScadaBridge.CentralUI.Services; namespace ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; /// /// Child component for the central Audit Log page (#23 M7 Bundle C / M7-T4..T8). /// Renders one in a right-side off-canvas drawer. /// The drawer owns only the offcanvas chrome — backdrop, header, and the two /// Close buttons; the single-row detail body (read-only fields, conditional /// Error/Request/Response/Extra subsections, and action buttons) is delegated /// to , which is shared with the execution-tree /// node-detail modal so a row's detail renders identically in either host. /// The drawer is fully presentational — it has no DB or service dependencies; /// the host page owns the open/close state. /// public partial class AuditDrilldownDrawer { /// /// The row to render. When null the drawer renders nothing — the host /// page uses this together with to drive visibility. /// [Parameter] public AuditEventView? Event { get; set; } /// /// True when the host wants the drawer visible. We deliberately keep /// this as a separate parameter from : an open /// drawer briefly with a null event renders nothing (the row may still /// be loading); a closed drawer with a stale event is the resting state. /// [Parameter] public bool IsOpen { get; set; } /// /// Fired when the user dismisses the drawer (close button or backdrop /// click). The host is expected to flip to false. /// [Parameter] public EventCallback OnClose { get; set; } private static string ShortEventId(Guid eventId) { // Mirror the "first 8 hex digits" presentation common across the UI. var n = eventId.ToString("N"); return n.Length >= 8 ? n[..8] : n; } private async Task HandleClose() { if (OnClose.HasDelegate) { await OnClose.InvokeAsync(); } } }