//go:build catalog

package web

import (
	"net/http"

	"github.com/a-h/templ"
	"github.com/go-chi/chi/v5"

	"backend/internal/web/ui/catalog"
)

// RegisterCatalogRoute mounts the /ui-catalog route.
// This file is only compiled with -tags catalog (dev tool; never ships to production).
func RegisterCatalogRoute(r chi.Router) {
	r.Get("/ui-catalog", catalogPageHandler())
}

func catalogPageHandler() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		templ.Handler(catalog.CatalogPage()).ServeHTTP(w, r)
	}
}
