diff options
author | Alan Pearce | 2025-03-18 22:40:46 +0100 |
---|---|---|
committer | Alan Pearce | 2025-03-19 17:33:58 +0100 |
commit | 896d844cac976afd0ee8aa73dd2fb28e15e7ac79 (patch) | |
tree | cc8d288d0039cb3d2084f43cafe8d4e0aea50e8b /internal/components/options.templ | |
parent | 1183108baa44fde88944e9207fb7763668c2b448 (diff) | |
download | searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.tar.lz searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.tar.zst searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.zip |
feat: Convert templ components to gomponents
Diffstat (limited to 'internal/components/options.templ')
-rw-r--r-- | internal/components/options.templ | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/internal/components/options.templ b/internal/components/options.templ deleted file mode 100644 index 097f66f..0000000 --- a/internal/components/options.templ +++ /dev/null @@ -1,45 +0,0 @@ -package components - -import ( - "go.alanpearce.eu/searchix/internal/config" - "go.alanpearce.eu/searchix/internal/index" - "go.alanpearce.eu/searchix/internal/nix" -) - -templ Options(result *index.Result) { - <table> - <thead> - <tr> - <th scope="col">Title</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.Option](hit.Data); m != nil { - @optionRow(hit, *m) - } - } - </tbody> - </table> -} - -templ optionRow(hit index.DocumentMatch, o nix.Option) { - <tr> - <td> - @openDialogLink(o.Name) - </td> - <td> - @markdown(firstSentence(o.Description)) - <dialog id={ o.Name }></dialog> - </td> - if config.DevMode { - <td> - @score(hit) - </td> - } - </tr> -} |