package routes

import (
	"net/http"

	"gitea.henriburau.de/haw-lan/cod4watcher/views/home"
	"github.com/davecgh/go-spew/spew"
)

func (s *Server) HandleHome(w http.ResponseWriter, r *http.Request) error {
	captureList, err := s.cs.GetActiveCapures(r.Context())
	if err != nil {
		return err
	}

	spew.Dump(r.Context())

	return Render(w, r, home.Index(captureList))
}
