using BCards.Web.Areas.Support.Services; using Microsoft.AspNetCore.Mvc; using System.Security.Claims; namespace BCards.Web.Areas.Support.ViewComponents; public class SupportFabViewComponent : ViewComponent { private readonly ISupportService _supportService; private readonly ILogger _logger; public SupportFabViewComponent(ISupportService supportService, ILogger logger) { _supportService = supportService; _logger = logger; } public async Task InvokeAsync() { try { var userId = UserClaimsPrincipal?.FindFirst(ClaimTypes.NameIdentifier)?.Value; var options = await _supportService.GetAvailableOptionsAsync(userId); _logger.LogDebug("SupportFab invocado para usuário {UserId} - Opções: Rating={CanRate}, Form={CanUseContactForm}, Telegram={CanAccessTelegram}", userId ?? "anônimo", options.CanRate, options.CanUseContactForm, options.CanAccessTelegram); return View(options); } catch (Exception ex) { _logger.LogError(ex, "Erro ao carregar SupportFab ViewComponent"); return Content(string.Empty); } } }