package view import ( "fmt" "stevenlr.com/locker/model" ) templ LockTokenForm(lock model.Lock) {

} func renderTimeString(value int, unit string) string { s := "" if value > 1 { s = "s" } return fmt.Sprint(value, " ", unit, s) } templ timeButton(id model.UUID, value int, unit string) { } templ LockInfo(lock model.Lock) {

Lock "{ lock.Name }"

Start time: { lock.StartTime.AsUTCString() }

End time: { lock.EndTime.AsUTCString() }

Total time:

Remaining time:

} templ LockView(lock model.Lock) {

Back to list

@LockInfo(lock)
if !lock.IsFinished() {

Add time

@timeButton(lock.Id, 15, "minute") @timeButton(lock.Id, 30, "minute") @timeButton(lock.Id, 1, "hour") @timeButton(lock.Id, 2, "hour") @timeButton(lock.Id, 6, "hour") @timeButton(lock.Id, 12, "hour") @timeButton(lock.Id, 1, "day") @timeButton(lock.Id, 1, "week") @timeButton(lock.Id, 4, "week")

}

API token

@LockTokenForm(lock) }