using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using OnlyOneAccessTemplate.Models;
using OnlyOneAccessTemplate.Services;

namespace OnlyOneAccessTemplate.Controllers
{
    [Route("en")]
    public class EnController : BaseController
    {
        public EnController(
            ISiteConfigurationService siteConfig,
            ILanguageService languageService,
            ISeoService seoService,
            IMemoryCache cache,
            IConfiguration configuration) 
            : base(siteConfig, languageService, seoService, cache, configuration)
        {
        }

        protected override string GetCurrentLanguage() => "en";

        [Route("")]
        [Route("index")]
        public IActionResult Index()
        {
            var siteConfig = _siteConfig.GetConfiguration("en");
            ViewBag.PageTitle = siteConfig.SiteTitle;
            ViewBag.PageDescription = siteConfig.SiteDescription;
            
            return View("~/Views/Home/Index.cshtml", siteConfig);
        }

        [Route("convert-pdf-to-word")]
        public IActionResult ConvertPdfToWord()
        {
            var siteConfig = _siteConfig.GetConfiguration("en");
            
            SetPageSeo("Convert PDF to Word Online Free", 
                      "Convert your PDF files to Word quickly and free...");
            
            return View("~/Views/Home/Index.cshtml", siteConfig);
        }
    }
}
