@inject NavigationManager NavigationManager

<div @onclick="ShowDetails" class="credential-card p-4 space-y-2 bg-white border border-gray-200 rounded-lg shadow-sm dark:border-gray-700
 dark:bg-gray-800 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors duration-200">
    <div class="px-4 py-2 text-gray-400 rounded text-center flex flex-col items-center">
        <DisplayFavicon faviconBytes="@Obj.Logo"></DisplayFavicon>
        <div>@Obj.Service</div>
        <div>@Obj.CreateDate.ToShortDateString()</div>
    </div>
</div>

@code {
    /// <summary>
    /// Gets or sets the credentials object to show.
    /// </summary>
    [Parameter]
    public required CredentialListEntry Obj { get; set; }

    private void ShowDetails()
    {
        // Redirect to view page instead for now.
        NavigationManager.NavigateTo($"/credentials/{Obj.Id}");
    }
}
