2024-09-11 17:31:40 +00:00
|
|
|
package partials
|
|
|
|
|
|
|
|
|
|
import "mhtml/h"
|
|
|
|
|
|
|
|
|
|
type Link struct {
|
|
|
|
|
Name string
|
|
|
|
|
Path string
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-11 23:41:21 +00:00
|
|
|
func NavBar() h.Renderable {
|
2024-09-11 17:31:40 +00:00
|
|
|
|
|
|
|
|
links := []Link{
|
|
|
|
|
{"Home", "/"},
|
|
|
|
|
{"News", "/news"},
|
|
|
|
|
{"Patients", "/patients"},
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-11 21:08:35 +00:00
|
|
|
return h.Nav(h.Class("flex gap-4 items-center p-4 text-slate-600"),
|
2024-09-12 17:15:17 +00:00
|
|
|
h.Boost(),
|
2024-09-11 21:08:35 +00:00
|
|
|
h.Children(
|
2024-09-11 23:41:21 +00:00
|
|
|
h.Map(links, func(link Link) h.Renderable {
|
2024-09-13 15:47:18 +00:00
|
|
|
return h.A(h.Text(link.Name), h.Href(link.Path), h.Class("cursor-pointer hover:text-blue-400"))
|
2024-09-12 17:15:17 +00:00
|
|
|
})...,
|
2024-09-11 21:08:35 +00:00
|
|
|
))
|
2024-09-11 17:31:40 +00:00
|
|
|
}
|