@model ShowLinkViewModel
@{
  ViewData["Title"] = $"Viewing link {Model.Link.Url}";

  @* var comments = (Application.CommentDTO[]) ViewData["Comments"]; *@
}

<h1>Viewing link @Model.Link.Url</h1>

@* <partial name="_LinkItem" model="@Model" /> *@
<a asp-controller="Comments" asp-action="Create" asp-route-linkId="@Model.Link.Id">Add comment</a>

@if(Model.Comments.Length == 0)
{
  <p>No comments yet.</p>
}
else
{
  <ul>
    @foreach (var comment in Model.Comments)
    {
        <li>@comment.Content</li>
    }
  </ul>
}