package capture
import "gitea.henriburau.de/haw-lan/cod4watcher/models"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/layouts"
import "gitea.henriburau.de/haw-lan/cod4watcher/views"
import "gitea.henriburau.de/haw-lan/cod4watcher/views/components"
import "fmt"
import "net/url"
templ Capture(capture *models.Capture, table models.ResultTable) {
@layouts.Base() {
{ capture.Name }
@components.ServerAddress(capture.Host, capture.Port)
Loading Server status...
@Pedestal(table)
@CaptureTable(table)
if views.Username(ctx) != "" {
@MapSelectTable(capture)
}
}
}
templ Medal(placement, name, color string) {
{ placement } { name }
}
templ Pedestal(table models.ResultTable) {
if len(table.Rows) >= 1 {
@Medal("1. Platz", table.Rows[0].Name, "text-yellow-400")
}
if len(table.Rows) >= 2 {
@Medal("2. Platz", table.Rows[1].Name, "text-gray-500")
}
if len(table.Rows) >= 3 {
@Medal("3. Platz", table.Rows[2].Name, "text-amber-700")
}
}
templ MapSelectTable(capture *models.Capture) {
}