using Microsoft.AspNetCore.Mvc.Rendering;

namespace economy.Models
{
    public class View<TRequest, TResponse>
    {
        public TRequest Request { get; set; }
        public TResponse Response { get; set; }

        // 한 페이지 보여줄 개수
        /*
        public enum ListPerPage
        {
            [Display(Name = "10개")]
            Default = 10,

            [Display(Name = "20개")]
            Second = 20,

            [Display(Name = "30개")]
            Third = 30,

            [Display(Name = "60개")]
            Fourth = 60,

            [Display(Name = "80개")]
            Fifth = 80,

            [Display(Name = "100개")]
            Sixth = 100
        }

        public ListPerPage SelectedListPerPage { get; set; } = ListPerPage.Default;

        // 사전에 미리 정의해 놓음
        public ListPerPage MatchListPerPage(int numOfRows)
        {
            var listPerPageMap = new Dictionary<int, ListPerPage>
            {
                { 10, ListPerPage.Default },
                { 20, ListPerPage.Second },
                { 30, ListPerPage.Third },
                { 60, ListPerPage.Fourth },
                { 80, ListPerPage.Fifth },
                { 100, ListPerPage.Sixth }
            };

            return listPerPageMap.ContainsKey(numOfRows) ? listPerPageMap[numOfRows] : ListPerPage.Default;
        }
        */

        public int SelectedListPerPage { get; set; }

        public List<SelectListItem> ListPerPage { get; } = new List<SelectListItem>
        {
            new SelectListItem { Value = "10", Text = "10개" },
            new SelectListItem { Value = "20", Text = "20개" },
            new SelectListItem { Value = "30", Text = "30개" },
            new SelectListItem { Value = "60", Text = "60개" },
            new SelectListItem { Value = "80", Text = "80개" },
            new SelectListItem { Value = "100", Text = "100개" },
            new SelectListItem { Value = "300", Text = "300개" },
            new SelectListItem { Value = "500", Text = "500개" }
        };

        public List<SelectListItem> FIFAListPerPage { get; } = new List<SelectListItem>
        {
            new SelectListItem { Value = "10", Text = "상위 10" },
            new SelectListItem { Value = "20", Text = "상위 20" },
            new SelectListItem { Value = "30", Text = "상위 30" },
            new SelectListItem { Value = "60", Text = "상위 60" },
            new SelectListItem { Value = "80", Text = "상위 80" },
            new SelectListItem { Value = "100", Text = "상위 100" },
            new SelectListItem { Value = "200", Text = "상위 200" },
            new SelectListItem { Value = "300", Text = "상위 300" }
        };

        public ChartData? Chart { get; set; }

        public Pagination Pagination { get; set; }
    }
}
