package components import ( "strconv" "go.alanpearce.eu/searchix/internal/nix" ) func convertMatch[I nix.Importable](m nix.Importable) *I { i := m.(I) return &i } templ Results(r ResultData) { if r.Query != "" { if r.Results != nil && r.Results.Total > 0 { switch r.Results.Hits[0].Data.(type) { case nix.Option: @Options(r.Results) case nix.Package: @Packages(r.Results) } } else { Nothing found } } else {
} } templ ResultsPage(r ResultData) { @SearchPage(r.TemplateData, r) { @Results(r) } } templ openDialogLink(attr string) { { attr } }