mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-25 05:58:29 -06:00
23 lines
528 B
Go
23 lines
528 B
Go
package component
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/maragudk/gomponents"
|
|
)
|
|
|
|
// RenderableGroup renders a group of nodes without a parent element.
|
|
//
|
|
// This is because gomponents.Group() cannot be directly rendered and
|
|
// needs to be wrapped in a parent element.
|
|
func RenderableGroup(children []gomponents.Node) gomponents.Node {
|
|
buf := bytes.Buffer{}
|
|
for _, child := range children {
|
|
err := child.Render(&buf)
|
|
if err != nil {
|
|
return gomponents.Raw("Error rendering group")
|
|
}
|
|
}
|
|
return gomponents.Raw(buf.String())
|
|
}
|