diff options
Diffstat (limited to 'internal/components/packages.templ')
-rw-r--r-- | internal/components/packages.templ | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/internal/components/packages.templ b/internal/components/packages.templ deleted file mode 100644 index 6e14026..0000000 --- a/internal/components/packages.templ +++ /dev/null @@ -1,48 +0,0 @@ -package components - -import ( - "go.alanpearce.eu/searchix/internal/config" - "go.alanpearce.eu/searchix/internal/index" - "go.alanpearce.eu/searchix/internal/nix" -) - -templ Packages(result *index.Result) { - <table> - <thead> - <tr> - <th scope="col">Attribute</th> - <th scope="col">Name</th> - <th scope="col">Description</th> - if config.DevMode { - <th scope="col">Score</th> - } - </tr> - </thead> - <tbody> - for _, hit := range result.Hits { - if m := convertMatch[nix.Package](hit.Data); m != nil { - @packageRow(hit, *m) - } - } - </tbody> - </table> -} - -templ packageRow(hit index.DocumentMatch, p nix.Package) { - <tr> - <td> - @openDialogLink(p.Attribute) - </td> - <td> - { p.Name } - </td> - <td> - { p.Description } - </td> - if config.DevMode { - <td> - @score(hit) - </td> - } - </tr> -} |