feat: add rudimentary DidController table

This commit is contained in:
Prad Nukala
2024-10-03 17:49:29 -04:00
parent f75ff0d3be
commit fccb42761c
16 changed files with 309 additions and 333 deletions
+24
View File
@@ -1,6 +1,9 @@
package pages
import (
"bytes"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/nebula/components/grant"
@@ -34,3 +37,24 @@ func Profile(c echo.Context) error {
func Register(c echo.Context) error {
return echoResponse(c, register.Modal(c))
}
// ╭───────────────────────────────────────────────────────────╮
// │ Helper Methods │
// ╰───────────────────────────────────────────────────────────╯
func echoResponse(c echo.Context, cmp templ.Component) error {
// Create a buffer to store the rendered HTML
buf := &bytes.Buffer{}
// Render the component to the buffer
err := cmp.Render(c.Request().Context(), buf)
if err != nil {
return err
}
// Set the content type
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
// Write the buffered content to the response
_, err = c.Response().Write(buf.Bytes())
return err
}