internal/components/detail.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | package components import ( "go.alanpearce.eu/searchix/internal/nix" g "go.alanpearce.eu/gomponents" ) func Detail(thing nix.Importable) g.Node { switch t := thing.(type) { case nix.Option: return OptionDetail(t) case nix.Package: return PackageDetail(t) default: return nil } } func DetailPage(tdata TemplateData, thing nix.Importable) g.Node { return Page(tdata, Detail(thing)) } |