using System.Text;
using SharepointToolbox.Core.Models;
namespace SharepointToolbox.Services.Export;
///
/// Generates the branding header HTML fragment for HTML reports.
/// Called by each HTML export service between <body> and <h1>.
/// Returns empty string when no logos are configured (no broken images).
///
internal static class BrandingHtmlHelper
{
public static string BuildBrandingHeader(ReportBranding? branding)
{
if (branding is null) return string.Empty;
var msp = branding.MspLogo;
var client = branding.ClientLogo;
if (msp is null && client is null) return string.Empty;
var sb = new StringBuilder();
sb.AppendLine("
");
if (msp is not null)
sb.AppendLine($"

");
if (msp is not null && client is not null)
sb.AppendLine("
");
if (client is not null)
sb.AppendLine($"

");
sb.AppendLine("
");
return sb.ToString();
}
}