| 1 | using AgentForge.Abstractions; |
| 2 | using AgentForge.Contracts; |
| 3 | using AgentForge.Data.Entities; |
| 4 | using AgentForge.Plugin.Org.Web.Components; |
| 5 | using AgentForge.Plugin.View; |
| 6 | using AgentForge.Plugin.View.Components; |
| 7 | |
| 8 | namespace AgentForge.Plugin.Org.Web.Pages; |
| 9 | |
| 10 | internal static class ForgeOrgHomePage |
| 11 | { |
| 12 | internal static string Render( |
| 13 | ForgeOrgEntity org, |
| 14 | IReadOnlyList<ForgeRepoGroupEntity> groups, |
| 15 | IReadOnlyList<RepoResponse> repos, |
| 16 | IReadOnlyDictionary<string, string> groupPaths, |
| 17 | ForgeOrgCatalogViewContext groupingContext, |
| 18 | IForgeOrgCatalogGrouping? grouping = null) => |
| 19 | ForgeHtml.Fragment( |
| 20 | ForgeViewTitle.Render(org.DisplayName), |
| 21 | ForgeViewSubtitle.Render(org.Description), |
| 22 | ForgeViewOrgMeta.Render(org.DefaultVisibility), |
| 23 | ForgeViewSectionHeading.Render("Catalog"), |
| 24 | grouping?.RenderToolbar(groupingContext) ?? "", |
| 25 | ForgeViewOrgRepoTree.Render( |
| 26 | org.Slug, |
| 27 | $"/view/orgs/{Uri.EscapeDataString(org.Slug)}", |
| 28 | groups, |
| 29 | repos, |
| 30 | groupPaths, |
| 31 | groupingContext, |
| 32 | grouping, |
| 33 | groupingContext.ActiveGroupPath)); |
| 34 | } |
| 35 | |