@foreach (var review in this.Reviews.Skip(this.skipQuantity).Take(this.takeQuantity))
{
    <div class="review_list">
        <div class="review_item">
            <div class="media">
                <div class="d-flex">
                    <img src="@review.ImageUrl" class="commentAvatar" alt="avatar" />
                </div>
                <AuthorizeView Roles="@GlobalConstants.AdministratorRole">
                    <button @onclick="@(() => this.OnDeleteReview.InvokeAsync(review.Id))" class="btn btn-danger btn-review-circle">
                        <i class="fas fa-trash-alt deleteReview-icon-collapse"></i>
                    </button>
                </AuthorizeView>
                <div class="media-body">
                    <h4>@review.FullName</h4>
                    @if (review.Username != null)
                    {
                        <span><a href="/Profile/@review.Username">@@@review.Username</a></span>
                    }
                    else
                    {
                        <span><a>Anonymous</a></span>
                    }
                    @if (review.UpdatedOn == null)
                    {
                        <h5>@review.CreatedOn.ToLocalTime().ToString("dd-MMMM-yyyy HH:mm tt")</h5>
                    }
                    else
                    {
                        <h5>@review.UpdatedOn?.ToLocalTime().ToString("dd-MMMM-yyyy HH:mm tt") (edited)</h5>
                    }
                    @for (int i = 0; i < review.Starts; i++)
                    {
                        <i class="fa fa-star"></i>
                    }
                    @for (int i = review.Starts; i < 5; i++)
                    {
                        <i class="fas fa-star notRatedStars"></i>
                    }
                </div>
            </div>
            <p>@review.Content</p>
        </div>
    </div>
}

<Pagination TotaPagesQuantity="this.TotalPagesQuantity"
            CurrentPage="this.currentPage"
            Radius="GlobalConstants.PaginationRadius"
            SelectedPage="this.SelectedPage">
</Pagination>

@code {
    private int currentPage = 1;
    private int skipQuantity = 0;
    private int takeQuantity = GlobalConstants.ReviewsOnPage;

    [Parameter]
    public ICollection<ReviewViewModel> Reviews { get; set; }

    [Parameter]
    public int TotalPagesQuantity { get; set; }

    [Parameter]
    public EventCallback<string> OnDeleteReview { get; set; }

    private void SelectedPage(int page)
    {
        this.currentPage = page;
        this.skipQuantity = (this.currentPage - 1) * GlobalConstants.ProductCommentsOnPage;
    }
}