using Microsoft.AspNetCore.Mvc; using PlotLine.Services; namespace PlotLine.ViewComponents; public sealed class EntitlementBannerViewComponent( ICurrentUserService currentUser, ISubscriptionService subscriptions) : ViewComponent { public async Task InvokeAsync() { if (currentUser.UserId is not int userId) { return Content(string.Empty); } var entitlement = await subscriptions.GetEffectiveEntitlementAsync(userId); return entitlement.IsReadOnly ? View(entitlement) : Content(string.Empty); } }