@* Placeholder modal for the /raw context-menu actions whose real dialogs
   (Configure / Device / TagModal / CSV import-export / Browse device / Rename)
   land in later Batch-2 waves (B/C). This wave wires every menu action to a
   named handler that opens this "coming soon" placeholder, so the tree + lazy
   expansion + menus can be live-verified without the real modals existing yet.
   Wave B/C replaces each handler body with the real modal invocation and can
   then delete this component. Markup mirrors the GlobalUns delete-confirm modal. *@

@if (Visible)
{
    <div class="modal-backdrop fade show" style="display:block"></div>
    <div class="modal fade show" tabindex="-1" role="dialog" style="display:block">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">@Title</h5>
                    <button type="button" class="btn-close" aria-label="Close" @onclick="OnClose"></button>
                </div>
                <div class="modal-body">
                    <p>@Message</p>
                    @if (!string.IsNullOrWhiteSpace(NodeName))
                    {
                        <p class="text-muted small mb-0">Target: <span class="mono">@NodeName</span></p>
                    }
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" @onclick="OnClose">Close</button>
                </div>
            </div>
        </div>
    </div>
}

@code {
    /// <summary>Whether the placeholder is shown.</summary>
    [Parameter] public bool Visible { get; set; }

    /// <summary>Modal title — the action name (e.g. "Configure driver").</summary>
    [Parameter] public string Title { get; set; } = "";

    /// <summary>"Coming soon" body message.</summary>
    [Parameter] public string Message { get; set; } = "";

    /// <summary>The target node's display name, shown as context.</summary>
    [Parameter] public string? NodeName { get; set; }

    /// <summary>Raised when the placeholder is dismissed.</summary>
    [Parameter] public EventCallback OnClose { get; set; }
}
