using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;

namespace DiplomovaPrace.Web.Admin.Shared.Common
{
	public partial class Pagination
	{
		[Parameter]
		public int PagesCount { get; set; }

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

		[Parameter]
		public EventCallback<int> PageShiftAsync { get; set; }

		[Parameter]
		public EventCallback<int> PageChangeAsync { get; set; }

		protected override void OnParametersSet()
		{
			base.OnParametersSet();
		}

		private async Task OnPageShiftAsync(int shiftValue)
		{
			await PageShiftAsync.InvokeAsync(shiftValue);
		}

		private async Task OnPageChangeAsync(int pageIndex)
		{
			await PageChangeAsync.InvokeAsync(pageIndex);
		}
	}
}