package components
import "git.src.quest/~skye/felu-ddns/internal/db"
import "strconv"
templ AdminPartialUsersList(users []db.User) {
<table class="table-auto">
<thead>
<tr>
<th class="text-start p-2">
Id
</th>
<th class="text-start p-2">
Email
</th>
<th class="text-start p-2">
Is Admin
</th>
</tr>
</thead>
<tbody>
for _, user := range users {
<tr class="border">
<td>
<div class="p-2">
<input class="border" value={ user.ID } disabled/>
</div>
</td>
<td>
<div class="p-2">
{ user.Email }
</div>
</td>
<td>
<div class="p-2">
{ strconv.FormatBool(user.IsAdmin) }
</div>
</td>
</tr>
}
</tbody>
</table>
}
templ AdminPartialDomainsList(domains []db.Domain) {
<table class="table-auto">
<thead>
<tr>
<th class="text-start p-2">
Id
</th>
<th class="text-start p-2">
Domain
</th>
<th class="text-start p-2">
A Record
</th>
<th class="text-start p-2">
Owner (ID/Email)
</th>
</tr>
</thead>
<tbody>
for _, domain := range domains {
<tr class="border">
<td>
<div class="p-2">
<input class="border" value={ domain.ID } disabled/>
</div>
</td>
<td>
<div class="p-2">
{ domain.Domain }
</div>
</td>
<td>
<div class="p-2">
{ domain.A }
</div>
</td>
<td>
<div class="p-2">
<div class="flex flex-row-reverse gap-1">
<input class="peer" type="checkbox"/>
<input class="border hidden peer-checked:block" value={ domain.Owner.Email } disabled/>
<input class="border block peer-checked:hidden" value={ domain.Owner.ID } disabled/>
</div>
</div>
</td>
</tr>
}
</tbody>
</table>
}