Finished phase005
CI / scan_ruby (push) Failing after 1m5s
CI / scan_js (push) Failing after 6s
CI / lint (push) Failing after 1m29s

This commit is contained in:
2026-09-16 15:34:50 -06:00
parent a3a65c24ed
commit 0826d267f2
38 changed files with 1596 additions and 9 deletions
@@ -0,0 +1,20 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["odometer", "warning"]
static values = {
currentOdometer: Number,
threshold: Number
}
check() {
const odometer = Number.parseInt(this.odometerTarget.value, 10)
if (Number.isNaN(odometer) || odometer >= this.currentOdometerValue - this.thresholdValue) {
this.warningTarget.hidden = true
return
}
this.warningTarget.hidden = false
}
}