diff options
Diffstat (limited to 'internal/components/results.templ')
-rw-r--r-- | internal/components/results.templ | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/components/results.templ b/internal/components/results.templ index 3953cc3..95c5390 100644 --- a/internal/components/results.templ +++ b/internal/components/results.templ @@ -2,9 +2,19 @@ package components import ( "strconv" + "log/slog" "searchix/internal/nix" ) +func convertMatch[I nix.Importable](m nix.Importable) *I { + i, ok := m.(I) + if !ok { + slog.Warn("Converting match failed", "match", m) + return nil + } + return &i +} + templ Results(r ResultData) { if r.Query != "" { if r.Results != nil && r.Results.Total > 0 { |