package pages

import (
	"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/components/page"
	"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/components/translate"
	"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/web/components"
)

templ Home(pages []page.PageHeader) {
	for _, page := range pages {
		@components.ImageTile("/images/" + page.CoverImageUID) {
			<a
				class="flex items-center justify-center h-full "
				href={ translate.Path(ctx, "/"+page.UID) }
				preload="mouseover"
				hx-load-links="true"
			>
				<h2
					class="text-3xl font-bold text-white hover:underline text-shadow-lg"
				>
					{ page.Title }
				</h2>
			</a>
		}
	}
}
