diff options
Diffstat (limited to 'internal/components/detail.templ')
-rw-r--r-- | internal/components/detail.templ | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/components/detail.templ b/internal/components/detail.templ new file mode 100644 index 0000000..6d6710c --- /dev/null +++ b/internal/components/detail.templ @@ -0,0 +1,20 @@ +package components + +import ( + "searchix/internal/nix" +) + +templ Detail(thing nix.Importable) { + switch thing.(type) { + case nix.Option: + @OptionDetail(thing.(nix.Option)) + case nix.Package: + @PackageDetail(thing.(nix.Package)) + } +} + +templ DetailPage(tdata TemplateData, thing nix.Importable) { + @Page(tdata) { + @Detail(thing) + } +} |