t2/views/components/capture_card.templ

16 lines
776 B
Plaintext

package components
import "gitea.henriburau.de/haw-lan/cod4watcher/models"
import "github.com/mergestat/timediff"
import "fmt"
templ CaptureCard(capture models.Capture) {
<div class="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">
<a href={ templ.URL(fmt.Sprintf("/captures/%d", capture.ID)) } >
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{ capture.Name }</h5>
</a>
<p class="font-normal text-gray-700 dark:text-gray-400">{ timediff.TimeDiff(capture.Start) }</p>
<button type="button" hx-delete={ fmt.Sprintf("/captures/%d", capture.ID) } class="mt-10 py-1 px-2 bg-red-500 text-white rounded-xl">Delete</button>
</div>
}