{{/*
    team-select: Reusable team dropdown.
    Pre-populated from server data — no client-side fetch needed.
*/}}
{{define "team-select"}}
<div class="form-group">
    {{if index . "Label"}}<label>{{index . "Label"}}</label>{{end}}
    <select name="{{index . "FieldName"}}" class="team-select">
        {{if index . "AllowEmpty"}}
        <option value="">— all teams —</option>
        {{end}}
        {{$sel := index . "Selected"}}
        {{range index . "Teams"}}
        <option value="{{.ID}}"{{if eq .ID $sel}} selected{{end}}>{{.Name}}</option>
        {{end}}
    </select>
</div>
{{end}}
