2026-01-11 22:33:21 +01:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using PlanTempus.Application.Features.Accounts.Models;
|
2026-01-12 15:42:18 +01:00
|
|
|
using PlanTempus.Application.Features.Localization.Services;
|
2026-01-11 22:33:21 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
2026-01-12 15:42:18 +01:00
|
|
|
private readonly ILocalizationService _localization;
|
|
|
|
|
|
|
|
|
|
public SubscriptionPlansViewComponent(ILocalizationService localization)
|
|
|
|
|
{
|
|
|
|
|
_localization = localization;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-11 22:33:21 +01:00
|
|
|
public IViewComponentResult Invoke()
|
|
|
|
|
{
|
|
|
|
|
var plans = PlanCatalog.GetAllPlans();
|
|
|
|
|
// Mock: current plan is "pro"
|
|
|
|
|
var currentPlanKey = "pro";
|
|
|
|
|
|
|
|
|
|
ViewBag.CurrentPlanKey = currentPlanKey;
|
2026-01-12 15:42:18 +01:00
|
|
|
ViewBag.Localization = _localization;
|
2026-01-11 22:33:21 +01:00
|
|
|
return View(plans);
|
|
|
|
|
}
|
|
|
|
|
}
|