Cookie consent banner

How do I implement a cookie consent banner (required in the EU) with Radzen "Default" security?

Okay, I got it!

I added a card to my login page with the cookie consent text and an "Accept" button.
You will also need to install the Blazored.LocalStorage library as NuGet package.

This is my code for reading and writing the cookie consent status in Login.razor.cs:

public partial class LoginComponent
{
    [Inject]
    Blazored.LocalStorage.ILocalStorageService localStorage { get; set; }
    
    public static bool cookieConsent { get; set; }
    
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            try
            {
                cookieConsent = await localStorage.GetItemAsync<string>("CookieConsent") == "true";
            }
            catch (Exception ex)
            {
                cookieConsent = false;
            }
            UriHelper.NavigateTo(UriHelper.Uri, forceLoad: false);
        }
    }

    public async Task SetConsent()
    {
        await localStorage.SetItemAsync("CookieConsent", "true");
        cookieConsent = true;
    }
}

I toggle the visibility of the card by the cookieConsent variable (Visible: ${!cookieConsent})
and the Accept button just executes the SetConsent() method. After accepting, the banner always stays invisible, even after closing the browser.