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:
@@ -0,0 +1,14 @@
|
||||
using MudBlazor;
|
||||
|
||||
namespace DeepDrftPublic.Client.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Single source of truth for mapping playback state to a transport glyph across
|
||||
/// DeepDrftPublic.Client. Surfaces that render a play/pause icon call <see cref="Resolve"/>
|
||||
/// instead of inlining their own ternary.
|
||||
/// </summary>
|
||||
public static class PlaybackIcons
|
||||
{
|
||||
public static string Resolve(bool isPlaying, bool isPaused)
|
||||
=> (isPlaying && !isPaused) ? Icons.Material.Filled.Pause : Icons.Material.Filled.PlayArrow;
|
||||
}
|
||||
Reference in New Issue
Block a user