Consolidate play/pause icon logic into PlaybackIcons mapper and PlayStateIcon component

Add Disabled parameter to PlayStateIcon; forward to MudIconButton;
pass Disabled="!IsLoaded" from PlayerControls to match Stop button parity.
This commit is contained in:
daniel-c-harvey
2026-06-06 10:46:32 -04:00
parent 1d97729e57
commit e3fe401abf
9 changed files with 93 additions and 19 deletions
@@ -1,16 +1,10 @@
using Microsoft.AspNetCore.Components;
using MudBlazor;
using Microsoft.AspNetCore.Components;
namespace DeepDrftPublic.Client.Controls.AudioPlayerBar;
public partial class PlayerControls : ComponentBase
{
[Parameter] public required bool IsPlaying { get; set; }
[Parameter] public required bool IsLoaded { get; set; }
[Parameter] public required EventCallback TogglePlayPause { get; set; }
[Parameter] public required EventCallback Stop { get; set; }
private string GetPlayIcon()
{
return IsPlaying ? Icons.Material.Filled.Pause : Icons.Material.Filled.PlayArrow;
}
}
}