rentease/internal/views/report_section.templ
2024-02-17 13:56:51 +01:00

53 lines
1.1 KiB
Text

package views
type ReportViewModel struct {
Id string
Url templ.SafeURL
Total string
CustomerName string
From string
To string
Platform string
PlatformFees string
}
templ ReportSection(report []*ReportViewModel) {
<div class="grid">
<h2>Your report </h2>
<div>
<button class="outline">Create PDF</button>
</div>
</div>
<div class="overflow-auto">
<table role="grid">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">From</th>
<th scope="col">To</th>
<th scope="col">Total (€)</th>
<th scope="col">Platform</th>
<th scope="col">Platform Fees</th>
</tr>
</thead>
<tbody>
for _, row := range report {
<tr>
<th scope="row">
<a href={ row.Url }>
{ row.Id }
</a>
</th>
<td>{ row.CustomerName }</td>
<td>{ row.From }</td>
<td>{ row.To }</td>
<td>{ row.Total }</td>
<td>{ row.Platform }</td>
<td>{ row.PlatformFees }</td>
</tr>
}
</tbody>
</table>
</div>
}