UI/WorkshopLinkButton.razor
@using Sandbox
@using Sandbox.UI
@inherits Panel
@namespace BlockParty
@attribute [StyleSheet( "WorkshopLinkButton.razor.scss" )]

@* Square thumbs-up button that opens a workshop level's Steam Workshop page in a web browser.
   Not a <button>: the engine only opens web links from a rich label's <a href> (see WebLinkLabel),
   and only the anchor's glyph hit-tests. So the square holds an INVISIBLE anchor glyph filling its
   face (transparent text colour, full-face font size) over the shared thumbs-up icon PNG — same trick
   as the workshop browser's link chip, with the pixel-art icon kept. This wrapper owns all the
   visuals (the label's own background would get baked into the anchor texture on hover rebuilds and
   stick). Clicks are stopped so a host screen's root onclick doesn't also fire. Position (and
   accents) come from the host's stylesheet. *@
<root class="square-btn i-thumbsup" onclick=@((PanelEvent e) => e.StopPropagation()) onmouseover=@((PanelEvent e) => OnHover?.Invoke( e ))>
	<div class="img"></div>
	<WebLinkLabel IsRich=@true Text=@AnchorHtml></WebLinkLabel>
</root>

@code
{
	/// <summary>The Steam Workshop item page (an absolute http/https URL).</summary>
	[Parameter] public string Url { get; set; }

	/// <summary>Hover hook for the host's tooltip layer (its Tip(...) handler).</summary>
	[Parameter] public Action<PanelEvent> OnHover { get; set; }

	// A Material Icons glyph is 1em square, so at the stylesheet's font size it covers the whole face;
	// it's drawn transparent — the visible thumbs-up is the sibling .img.
	private string AnchorHtml => $"<a href=\"{Url}\">thumb_up</a>";

	protected override int BuildHash() => System.HashCode.Combine( Url );
}