PlanTempusApp/PlanTempus.Application/Features/Account/Components/SubscriptionPlans/SubscriptionPlansViewComponent.cs
Janus C. H. Knudsen ef174af0e1 Adds localization support across application views
Implements localization for dashboard, cash register, account, and profile sections

Adds localization keys for various UI elements, improving internationalization support
Refactors view components to use ILocalizationService for dynamic text rendering
Prepares ground for multi-language support with translation-ready markup
2026-01-12 15:42:18 +01:00

30 lines
915 B
C#

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);
}
}