PlanTempusApp/PlanTempus.Application/Features/Account/Components/SubscriptionPlans/SubscriptionPlansViewComponent.cs

31 lines
915 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Mvc;
using PlanTempus.Application.Features.Accounts.Models;
using PlanTempus.Application.Features.Localization.Services;
namespace PlanTempus.Application.Features.Account.Components;
/// <summary>
/// ViewComponent for the subscription plan selection grid.
/// Shows all available plans with the current plan highlighted.
/// </summary>
public class SubscriptionPlansViewComponent : ViewComponent
{
private readonly ILocalizationService _localization;
public SubscriptionPlansViewComponent(ILocalizationService localization)
{
_localization = localization;
}
public IViewComponentResult Invoke()
{
var plans = PlanCatalog.GetAllPlans();
// Mock: current plan is "pro"
var currentPlanKey = "pro";
ViewBag.CurrentPlanKey = currentPlanKey;
ViewBag.Localization = _localization;
return View(plans);
}
}