28 lines
949 B
C#
28 lines
949 B
C#
using Tesses.WebServer;
|
|
using Scriban;
|
|
using System.Web;
|
|
|
|
namespace Tesses.YouTubeDownloader2025Companion
|
|
{
|
|
public class PageLink(string title, string icon, string url, bool active,string badge="") {
|
|
public string Title => HttpUtility.HtmlEncode(title);
|
|
public string Icon => HttpUtility.HtmlEncode(icon);
|
|
public string Url => HttpUtility.HtmlAttributeEncode(url);
|
|
|
|
public bool Active => active;
|
|
|
|
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
|
|
});
|
|
}
|
|
|
|
}
|
|
} |