@using SteUp.Shared.Components.Layout.Spinner

<MudOverlay Visible="VisibleOverlay" LightBackground="true">
    @if (SuccessAnimation)
    {
        <div class="overlay-content">
            <div class="success-checkmark">
                <div class="check-icon">
                    <span class="icon-line line-tip"></span>
                    <span class="icon-line line-long"></span>
                    <div class="icon-circle"></div>
                    <div class="icon-fix"></div>
                </div>
            </div>
            @if (!string.IsNullOrWhiteSpace(Message))
            {
                <p class="overlay-message">@Message</p>
            }
        </div>
    }
    else
    {
        <div class="overlay-content">
            <SpinnerLayout/>
            @if (!string.IsNullOrWhiteSpace(Message))
            {
                <p class="overlay-message">@Message</p>
            }
        </div>
    }
</MudOverlay>

@code {
    [Parameter] public required bool SuccessAnimation { get; set; }
    [Parameter] public required bool VisibleOverlay { get; set; }

    /// Testo opzionale mostrato sotto lo spinner/spunta (es. "Invio scheda 3 di 7…").
    [Parameter] public string? Message { get; set; }
}