| 1 | using AgentForge.Data.Entities; |
| 2 | using AgentForge.Models; |
| 3 | |
| 4 | namespace AgentForge.Plugin.View.Components.Iop; |
| 5 | |
| 6 | internal static class ForgeViewIopMrHeader |
| 7 | { |
| 8 | internal static string Render(string repoName, ForgeMergeRequestEntity mergeRequest) |
| 9 | { |
| 10 | var parts = new List<string> |
| 11 | { |
| 12 | ForgeHtml.P("iop-meta", |
| 13 | ForgeHtml.A( |
| 14 | $"/view/repos/{ForgeRepoNames.ToUrlPath(repoName)}/merge-requests/{mergeRequest.Number}", |
| 15 | $"!{mergeRequest.Number}")), |
| 16 | ForgeHtml.P("iop-mr-title", ForgeHtml.Text(mergeRequest.Title)), |
| 17 | ForgeHtml.P("iop-meta", |
| 18 | ForgeViewIopStatusPill.Render(mergeRequest.Status), |
| 19 | ForgeHtml.Sep(), |
| 20 | ForgeHtml.Text(mergeRequest.SourceBranch), |
| 21 | ForgeHtml.Text(" → "), |
| 22 | ForgeHtml.Text(mergeRequest.TargetBranch)), |
| 23 | }; |
| 24 | |
| 25 | if (!string.IsNullOrWhiteSpace(mergeRequest.CreatedBy)) |
| 26 | { |
| 27 | parts.Add(ForgeHtml.P("iop-meta", |
| 28 | ForgeHtml.Text("opened by "), |
| 29 | ForgeHtml.Strong(mergeRequest.CreatedBy))); |
| 30 | } |
| 31 | |
| 32 | return ForgeHtml.Fragment([.. parts]); |
| 33 | } |
| 34 | } |
| 35 | |
View only · write via MCP/CIDE