using Microsoft.AspNetCore.Components; using DeepDrftModels.DTOs; namespace DeepDrftShared.Client.Components; public partial class TracksGallery : ComponentBase { [Parameter] public IEnumerable Tracks { get; set; } = []; // Controlled play-state inputs: the parent owns playback truth (the player service) // and drives these. The gallery is presentational — it only matches by id to decide // which card reflects the active state. [Parameter] public TrackDto? ActiveTrack { get; set; } [Parameter] public bool IsPlaying { get; set; } [Parameter] public bool IsPaused { get; set; } [Parameter] public EventCallback OnPlay { get; set; } [Parameter] public EventCallback OnPause { get; set; } private Task HandlePlayClick(TrackDto track) => OnPlay.HasDelegate ? OnPlay.InvokeAsync(track) : Task.CompletedTask; private Task HandlePauseClick(TrackDto track) => OnPause.HasDelegate ? OnPause.InvokeAsync(track) : Task.CompletedTask; }