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