@page "{userIndex}"

@model UserModel
@{
    ViewData["Title"] = "User #" + @Model.userId;
}

<div class="text-left">
    <form method="post">
        <label asp-for="UserNickName">Preferred Name</label>
        <input asp-for="UserNickName" />
        <br />
        <label asp-for="UserName">Contact Name</label>
        <input asp-for="UserName" disabled /> 
        <br />
        <input type="submit" value="Submit" />
    </form>
    @if(@Model.IsSpotifyAuthenticated)
    {
        <form method="post" >
            <input name="userIndex" value="@Model.userId" type="hidden" /> 
            <input type="submit" value="Deauthorize Spotify"  asp-page-handler="SpotifyLogout" />
        </form>
    }
    else
    {
        <form method="post" >
            <input name="userIndex" value="@Model.userId" type="hidden" /> 
            <input type="submit" value="Connect to Spotify"  asp-page-handler="SpotifyLogin" />
        </form>
    }
</div>
