Files
tytdcompanion/Components/Shell.cs
T
2026-03-15 22:15:34 -05:00

30 lines
1.0 KiB
C#

using Tesses.WebServer;
using Scriban;
using System.Web;
namespace Tesses.YouTubeDownloader2025Companion
{
public class PageLink(string title, string icon, string url,string badge="") {
public string Title => HttpUtility.HtmlEncode(title);
public string Icon => HttpUtility.HtmlEncode(icon);
public string Url => HttpUtility.HtmlAttributeEncode(url);
public string Badge => HttpUtility.HtmlEncode(badge);
}
public static partial class Components {
private static ReloadingScript shell = new ReloadingScript("wwwroot/components/shell.sbnhtml");
public static string Shell(string title, string body, IEnumerable<PageLink> pages)
{
return shell.Render(new {
Title = System.Web.HttpUtility.HtmlEncode(title),
Body = body,
Pages = pages
});
}
internal static string Shell(string v1, string v2, object defaultLinks)
{
throw new NotImplementedException();
}
}
}