using SharepointToolbox.Core.Models;
using System.IO;
using System.Text;
namespace SharepointToolbox.Services.Export;
///
/// Exports StorageNode tree to a self-contained HTML file with collapsible subfolder rows.
/// Port of PS Export-StorageToHTML (PS lines 1621-1780).
/// Uses a toggle(i) JS pattern where each collapsible row has id="sf-{i}".
///
public class StorageHtmlExportService
{
private int _togIdx;
public string BuildHtml(IReadOnlyList nodes)
{
_togIdx = 0;
var sb = new StringBuilder();
sb.AppendLine("""
SharePoint Storage Metrics