| 1 | using AgentForge.Abstractions; |
| 2 | using AgentForge.Contracts; |
| 3 | using AgentForge.Plugin.View; |
| 4 | |
| 5 | namespace AgentForge.Plugin.Org.Web.Components; |
| 6 | |
| 7 | internal static class ForgeViewOrgRepoNode |
| 8 | { |
| 9 | internal static string Render(RepoResponse repo) => |
| 10 | ForgeHtml.Li(null, |
| 11 | ForgeHtml.Text("📦 "), |
| 12 | ForgeHtml.A($"/view/repos/{ForgeRepoNames.ToUrlPath(repo.Name)}", ShortRepoName(repo.Name)), |
| 13 | ForgeHtml.Text(" "), |
| 14 | ForgeHtml.Badge(repo.DriveMode), |
| 15 | ForgeHtml.Text(" "), |
| 16 | ForgeHtml.Badge(repo.Visibility)); |
| 17 | |
| 18 | private static string ShortRepoName(string fullName) |
| 19 | { |
| 20 | var slash = fullName.IndexOf('/', StringComparison.Ordinal); |
| 21 | return slash >= 0 ? fullName[(slash + 1)..] : fullName; |
| 22 | } |
| 23 | } |
| 24 |