@model IEnumerable<IGrouping<string,BlogPost>>
@{
    ViewData["Title"] = "Blogs, l'index";
}
@section header {
    <style>
        .collapsed {
            height: 1em;
        }
        .sametitlegrip {
            text-decoration: underline;
            cursor: pointer;
        }
        .sametitle {
            overflow: hidden;
            transition: height 1s;
        }
        td {
            transition: height 1s;
        }
        div.row {
            border-bottom: dashed black 1px;
        }
        </style>
}
@section scripts {
    <script>
        $(document).ready(function () {
                $(".sametitle").addClass("collapsed")
                .on("mouseover",function(){
                    $(this).removeClass("collapsed")
                }).on("mouseout",function(){
                    $(this).addClass("collapsed")
                });
            }
        )
   </script>
}
<h2>@ViewData["Title"]</h2>
<p class="text-success">@ViewData["StatusMessage"]</p>
@if (User.IsSignedIn()) {
<p>
    <a asp-action="Create">Create a new article</a>
</p>
}

<div class="container">
     @await Component.InvokeAsync("BlogIndex",new{ id = User.GetUserId() ?? "_anonymous_" })   
</div>
