| 1 | namespace AgentForge.Plugin.View.Components.Layout; |
| 2 | |
| 3 | internal static class ForgeViewHeaderSearch |
| 4 | { |
| 5 | public static string Render(ForgeViewPageContext ctx) => |
| 6 | ForgeHtml.Form( |
| 7 | "get", |
| 8 | $"/view/repos/{Uri.EscapeDataString(ctx.RepoName)}/search", |
| 9 | "header-search", |
| 10 | "search", |
| 11 | ForgeHtml.LabelWithClass("header-search-q", "sr-only", ForgeHtml.Text("Search repository")), |
| 12 | ForgeHtml.Mark("header-search-icon", "⌕", ariaHidden: true), |
| 13 | ForgeHtml.Input(new ForgeInputSpec( |
| 14 | "q", |
| 15 | Id: "header-search-q", |
| 16 | Type: "search", |
| 17 | Placeholder: "Search…", |
| 18 | Autocomplete: "off", |
| 19 | Value: string.IsNullOrWhiteSpace(ctx.SearchQuery) ? null : ctx.SearchQuery))); |
| 20 | } |
| 21 | |
View only · write via MCP/CIDE