using Microsoft.AspNetCore.Mvc;
using Shride.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Shride.Components
{
    public class UserVehicleListViewComponent : ViewComponent
    {
        private IRideRepository repository;

        public UserVehicleListViewComponent(IRideRepository repo)
        {
            repository = repo;
        }

        public IViewComponentResult Invoke()
        {
            return View("UserVehicleList", repository.UserAccount.Vehicles.ToList());

        }
    }
}
