UI/TrophyIcon.razor
@using Sandbox.UI
@inherits Panel
@namespace BlockParty
@attribute [StyleSheet( "TrophyIcon.razor.scss" )]
<root class=@TrophyName style=@IconStyle onmouseover=@OnHover></root>
@code
{
[Parameter] public System.Action<PanelEvent> OnHover { get; set; }
[Parameter] public int Place { get; set; }
[Parameter] public int Size { get; set; } = 32;
private string TrophyName => Place switch { 1 => "gold", 2 => "silver", 3 => "bronze", _ => "" };
private string IconStyle => $"width:{Size}px;height:{Size}px;";
protected override int BuildHash() => System.HashCode.Combine( Place, Size );
}