Add Icon support to CardList

This commit is contained in:
Ivan Yaremenchuk 2022-09-04 11:44:01 -05:00
parent b9c93eb116
commit 4ded842c9e
2 changed files with 3 additions and 2 deletions

View File

@ -40,9 +40,9 @@
<div class="d-flex flex-row align-items-center justify-content-end">
@foreach (var button in cardListItem.Buttons ?? Array.Empty<CardListItemButton>())
{
if (!string.IsNullOrEmpty(button?.Name))
if (!string.IsNullOrEmpty(button?.Name) || !string.IsNullOrEmpty(button?.Icon))
{
<RadzenButton Text="@button.Name" Click="@button.Action" ButtonStyle="@button.Style"
<RadzenButton Text="@button.Name" Icon="@button.Icon" Click="@button.Action" ButtonStyle="@button.Style"
Disabled="SelectedItems == null || !SelectedItems.Contains(cardListItem.Id)"/>
}
}

View File

@ -5,6 +5,7 @@ namespace NftFaucetRadzen.Components.CardList;
public class CardListItemButton
{
public string Name { get; set; }
public string Icon { get; set; }
public Action Action { get; set; }
public ButtonStyle Style { get; set; }
}