
@using global::Shared.DTOs
@inject HttpClient _hc
<div class="contact-info-area pb-90" id="blog">
    <div class="container">
        <div class="row">
        </div>
    </div>
</div>
<div class="tp-project__area grey-bg pt-50 pb-50 fix" >
    <div class="blog-grid-inner mb-10">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="popular-blog-title mb-40 text-center">
                        <h4>آخرین پست ها</h4>
                    </div>
                </div>
            </div>
            <div class="row">
                @foreach (var item in items)
                {
                    <ItemBlog Item="item" />
                }
               
            </div>
            <NavLink href="ListBlog">
                <span>ادامه دارد ...</span>
                <b></b>
            </NavLink>
        </div>
    </div>
</div>

@code {
    List<BlogDto> items = new List<BlogDto>();
    protected override async Task OnInitializedAsync()
    {
        var request = await _hc.GetFromJsonAsync<PagingDto<BlogDto>>("Base/LastBlog?PageIndex=1&PageSize=3");
        items = request.list;
        await base.OnInitializedAsync();
    }
}
