| 1 | using AgentForge.Abstractions; |
| 2 | using AgentForge.Contracts; |
| 3 | using AgentForge.Data.Entities; |
| 4 | using AgentForge.Models; |
| 5 | using AgentForge.Plugin.Org.Web.Components; |
| 6 | using AgentForge.Plugin.View; |
| 7 | using AgentForge.Plugin.View.Components; |
| 8 | |
| 9 | namespace AgentForge.Plugin.Org.Web.Pages; |
| 10 | |
| 11 | internal static class ForgePersonalHomePage |
| 12 | { |
| 13 | internal static string Render( |
| 14 | ForgeIdentityEntity identity, |
| 15 | ForgeOrgEntity personalOrg, |
| 16 | IReadOnlyList<ForgeRepoGroupEntity> groups, |
| 17 | IReadOnlyList<RepoResponse> repos, |
| 18 | IReadOnlyDictionary<string, string> groupPaths, |
| 19 | ForgeOrgCatalogViewContext groupingContext, |
| 20 | IForgeOrgCatalogGrouping? grouping = null) => |
| 21 | ForgeHtml.Fragment( |
| 22 | ForgeViewTitle.Render(personalOrg.DisplayName), |
| 23 | ForgeViewSubtitle.Render( |
| 24 | $"Personal catalog · {identity.Login} · agent-knowledge/canon · default {personalOrg.DefaultVisibility.ToSlug()}"), |
| 25 | ForgeViewOrgMeta.Render(personalOrg.DefaultVisibility), |
| 26 | ForgeViewSectionHeading.Render("Catalog"), |
| 27 | grouping?.RenderToolbar(groupingContext) ?? "", |
| 28 | ForgeViewOrgRepoTree.Render( |
| 29 | personalOrg.Slug, |
| 30 | "/view/me", |
| 31 | groups, |
| 32 | repos, |
| 33 | groupPaths, |
| 34 | groupingContext, |
| 35 | grouping, |
| 36 | groupingContext.ActiveGroupPath)); |
| 37 | } |
| 38 | |