Files
deepdrft/DeepDrftShared.Client/Components/TrackCard.razor.cs
T
Daniel Harvey 8b8796fc58 refactor(split): extract DeepDrftShared.Client RCL with shared atoms
TrackCard, TracksGallery, DDIcons, DeepDrftPalettes (Default+Cms), DeepDrftFontLinks,
and palette CSS tokens extracted. Both hosts and DeepDrftCms reference the shared RCL.
2026-05-19 17:14:23 -04:00

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);
}
}
}