mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-23 21:19:31 -06:00
Add GMap component for rendering a map with gomponents
This commit is contained in:
9
internal/view/web/component/gmap.go
Normal file
9
internal/view/web/component/gmap.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package component
|
||||
|
||||
import "github.com/maragudk/gomponents"
|
||||
|
||||
// GMap is a convenience function to render a gomponents.Group
|
||||
// with a map inside.
|
||||
func GMap[T any](ts []T, cb func(T) gomponents.Node) gomponents.Node {
|
||||
return gomponents.Group(gomponents.Map(ts, cb))
|
||||
}
|
||||
Reference in New Issue
Block a user