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.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user