Migrate from templates to Gomponents (#103)
This commit is contained in:
parent
5cad4cbd33
commit
62d46c475c
104 changed files with 2768 additions and 2824 deletions
20
pkg/ui/pages/search.go
Normal file
20
pkg/ui/pages/search.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package pages
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/mikestefanello/pagoda/pkg/ui"
|
||||
"github.com/mikestefanello/pagoda/pkg/ui/layouts"
|
||||
"github.com/mikestefanello/pagoda/pkg/ui/models"
|
||||
. "maragu.dev/gomponents"
|
||||
)
|
||||
|
||||
func SearchResults(ctx echo.Context, results []*models.SearchResult) error {
|
||||
r := ui.NewRequest(ctx)
|
||||
|
||||
g := make(Group, len(results))
|
||||
for i, result := range results {
|
||||
g[i] = result.Render()
|
||||
}
|
||||
|
||||
return r.Render(layouts.Primary, g)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue