@if (Variant == CardVariant.Product)
{
if (ShowBadges && (Badges is not null || BadgesContent is not null))
{
@Badges
@BadgesContent
}
if (ShowActions && Actions is not null)
{
}
@if (Image is not null)
{
@Image
}
else if (!string.IsNullOrWhiteSpace(ImagePlaceholderText))
{
@ImagePlaceholderText
}
@if (ShowMeta && Meta is not null)
{
@Meta
}
@if (ShowHeading && Heading is not null)
{
@Heading
}
@if (ShowRating && Rating is not null)
{
@Rating
}
@if (ShowDescription && Description is not null)
{
@Description
}
@if (ShowPrices && Prices is not null)
{
@Prices
}
@if (ShowFooter && Footer is not null)
{
}
}
else if (Variant == CardVariant.Category)
{
if (!string.IsNullOrWhiteSpace(LinkHref))
{
@CategoryContent
}
else
{
@CategoryContent
}
}
@code {
private const string ProductRootClass = "product-card";
private const string ProductLayoutGridClass = "product-card--layout--grid";
private const string ProductLayoutListClass = "product-card--layout--list";
private const string CategoryRootClass = "card";
private const string CategoryCardClass = "category-card";
[Parameter]
public CardVariant Variant { get; set; } = CardVariant.Product;
[Parameter]
public string Layout { get; set; } = "grid";
[Parameter]
public string CssClass { get; set; } = string.Empty;
[Parameter]
public string ImagePlaceholderText { get; set; } = "Image coming soon";
[Parameter]
public string? LinkHref { get; set; }
[Parameter]
public string? LinkTarget { get; set; }
[Parameter]
public string? LinkRel { get; set; }
[Parameter]
public EventCallback