8b8796fc58
TrackCard, TracksGallery, DDIcons, DeepDrftPalettes (Default+Cms), DeepDrftFontLinks, and palette CSS tokens extracted. Both hosts and DeepDrftCms reference the shared RCL.
23 lines
665 B
C#
23 lines
665 B
C#
using Microsoft.AspNetCore.Components;
|
|
using DeepDrftModels.Entities;
|
|
using MudBlazor;
|
|
|
|
namespace DeepDrftShared.Client.Components;
|
|
|
|
public partial class TrackCard : ComponentBase
|
|
{
|
|
[Parameter] public required TrackEntity TrackModel { get; set; }
|
|
[Parameter] public EventCallback<TrackEntity> OnPlay { get; set; }
|
|
[Parameter] public bool IsPlaying { get; set; } = false;
|
|
|
|
private string PlayPauseIcon => IsPlaying ? Icons.Material.Filled.MusicNote : Icons.Material.Filled.PlayArrow;
|
|
|
|
private async Task PlayClick()
|
|
{
|
|
if (!IsPlaying && OnPlay.HasDelegate)
|
|
{
|
|
await OnPlay.InvokeAsync(TrackModel);
|
|
}
|
|
}
|
|
}
|