godash/components/application.templ

28 lines
820 B
Text
Raw Normal View History

2024-03-18 16:12:25 +01:00
package components
2024-03-12 15:49:08 +01:00
2024-09-16 11:45:24 +02:00
import "gitlab.unjx.de/flohoss/godash/services"
2024-03-14 16:33:34 +01:00
func displayDark(app services.Application) bool {
return !app.IgnoreDark && app.IconLight != ""
}
2024-03-12 15:49:08 +01:00
templ Application(application services.Application) {
<a href={ templ.URL(application.URL) } class="flex items-center hover-effect">
<div class={ "w-8", "h-8", "flex", templ.KV("dark:hidden", displayDark(application)), "items-center" }>
2024-06-11 11:27:17 +02:00
@templ.Raw(application.Icon)
</div>
if displayDark(application) {
2024-09-30 20:16:29 +02:00
<div class={ "w-8", "h-8", "hidden", "dark:flex", "items-center" }>
@templ.Raw(application.IconLight)
</div>
}
2024-03-12 15:49:08 +01:00
<div class="uppercase truncate ml-2">{ application.Name }</div>
</a>
}
2024-03-18 16:12:25 +01:00
templ Link(link services.Link) {
<a href={ templ.URL(link.URL) } class="hover-effect">
<div class="truncate">{ link.Name }</div>
</a>
}