2022-08-27 15:37:09 -05:00

52 lines
2.6 KiB
Plaintext

@using NftFaucetRadzen.Models
@inherits BasicComponent
<RadzenDataList WrapItems="true" Data="@Data" TItem="CardListItem" >
<Template Context="cardListItem">
<RadzenCard class=@("box"
+ (cardListItem.IsDisabled ? " box-disabled" : string.Empty)
+ (SelectedItems != null && SelectedItems.Contains(cardListItem.Id) ? " box-selected" : string.Empty))
Style="width: 250px;" onclick="@(async () => await ToggleSelection(cardListItem))">
<div class="d-flex flex-row align-items-center">
@if (SelectedItems != null && SelectedItems.Contains(cardListItem.Id))
{
<Checkmark AnchorToTopRightCorner="true"/>
}
@if (!string.IsNullOrEmpty(cardListItem.ImageName))
{
<RadzenImage Path=@($"./images/{cardListItem.ImageName}") Class="float-left mr-3" Style="width: 80px; height: 80px; margin-right: 1em;"/>
}
<div>
<h4 class="mb-0">@cardListItem.Header</h4>
@foreach (var property in cardListItem.Properties ?? Array.Empty<CardListItemProperty>())
{
if (!string.IsNullOrEmpty(property?.Value))
{
<div style="font-size: .8em">@property.Name: @property.Value</div>
}
}
<div>
@foreach (var badge in cardListItem.Badges ?? Array.Empty<CardListItemBadge>())
{
if (!string.IsNullOrEmpty(badge?.Text))
{
<RadzenBadge BadgeStyle="@badge.Style" IsPill="true" Text="@badge.Text"/>
}
}
</div>
<div>
@foreach (var button in cardListItem.Buttons ?? Array.Empty<CardListItemButton>())
{
if (!string.IsNullOrEmpty(button?.Name))
{
<RadzenButton Text="@button.Name" Click="@button.Action" ButtonStyle="@button.Style"
Disabled="SelectedItems == null || !SelectedItems.Contains(cardListItem.Id)" />
}
}
</div>
</div>
</div>
</RadzenCard>
</Template>
</RadzenDataList>