@inject NavigationManager Navigation

@code {
    [Parameter] public string Screen { get; set; } = "";
    [Parameter] public string Feature { get; set; } = "";
    [Parameter] public string Action { get; set; } = "";
    [Parameter] public string Step { get; set; } = "";
    [Parameter] public string Entity { get; set; } = "";
    [Parameter] public string EntityId { get; set; } = "";
    [Parameter] public string DataKey { get; set; } = "";

    protected override Task OnAfterRenderAsync(bool firstRender)
    {
        if (!firstRender)
            return Task.CompletedTask;

        try
        {
            var context = string.Join("|", new[]
            {
                Screen,
                Feature,
                Action,
                Step,
                Entity,
                EntityId,
                DataKey
            });

            _ = context;
        }
        catch
        {
            // Telemetry must never break the page.
        }

        return Task.CompletedTask;
    }
}
