UI/PlayPage.razor
@using Sandbox.UI;
@using Sandbox.UI.Navigation;
@inherits Panel
@attribute [Route( "/play" )]

<root class="menu-page">

	<label class="page-heading">PLAY</label>

	@if ( GameFlowManager.LocalTestingEnabled && !Sandbox.Application.IsEditor )
	{
		<label class="page-copy">LOCAL TEST MODE · Find Match reconnects to the editor host.</label>
	}

	<label class="page-copy">
		Search for another available player. If no match exists,
		you will host one automatically.
	</label>

	<div
		class="menu-button matchmaking-button"
		onclick=@FindMatch
	>
		<label class="button-title">FIND MATCH</label>
		<label class="button-description">
			Online 1v1 · First available opponent
		</label>
	</div>

	<a
		href="/"
		class="menu-back"
	>
		BACK
	</a>

</root>

@code
{
	protected override int BuildHash() => GameFlowManager.LocalTestingEnabled.GetHashCode();

	private void FindMatch()
	{
		MainMenuHost.Current?.
			FindMatch();
	}
}