using ladaexpress.vn.Infrastructures.Services;
using Microsoft.AspNetCore.Mvc;

namespace ladaexpress.vn.Components
{
    public class TopicBlockViewComponent : ViewComponent
    {
        private readonly ITopicService _topicService;

        public TopicBlockViewComponent(ITopicService topicService)
        {
            _topicService = topicService;
        }

        public async Task<IViewComponentResult> InvokeAsync(string systemName)
        {
            var products = await _topicService.PrepareTopicDetailBySystemName(systemName);
            return View(products); // Truyền dữ liệu vào View
        }
    }
}
