27 lines
820 B
Text
27 lines
820 B
Text
package components
|
|
|
|
import "gitlab.unjx.de/flohoss/godash/services"
|
|
|
|
func displayDark(app services.Application) bool {
|
|
return !app.IgnoreDark && app.IconLight != ""
|
|
}
|
|
|
|
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" }>
|
|
@templ.Raw(application.Icon)
|
|
</div>
|
|
if displayDark(application) {
|
|
<div class={ "w-8", "h-8", "hidden", "dark:flex", "items-center" }>
|
|
@templ.Raw(application.IconLight)
|
|
</div>
|
|
}
|
|
<div class="uppercase truncate ml-2">{ application.Name }</div>
|
|
</a>
|
|
}
|
|
|
|
templ Link(link services.Link) {
|
|
<a href={ templ.URL(link.URL) } class="hover-effect">
|
|
<div class="truncate">{ link.Name }</div>
|
|
</a>
|
|
}
|