unify components and layout
This commit is contained in:
34
pkg/web/components/header.templ
Normal file
34
pkg/web/components/header.templ
Normal file
@@ -0,0 +1,34 @@
|
||||
package components
|
||||
|
||||
type HeaderProps struct {
|
||||
Title string
|
||||
NavbarStart templ.Component
|
||||
NavbarCenter templ.Component
|
||||
NavbarEnd templ.Component
|
||||
}
|
||||
|
||||
templ Header(props HeaderProps) {
|
||||
<header class="navbar bg-primary text-primary-content px-4 min-h-10">
|
||||
<div class="navbar-start">
|
||||
<span class="font-semibold mr-5">
|
||||
<a
|
||||
hx-get="/"
|
||||
hx-target="main"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
{ props.Title }
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="navbar-center">
|
||||
if props.NavbarCenter != nil {
|
||||
@props.NavbarCenter
|
||||
}
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
if props.NavbarEnd != nil {
|
||||
@props.NavbarEnd
|
||||
}
|
||||
</div>
|
||||
</header>
|
||||
}
|
||||
Reference in New Issue
Block a user