Files
blockcatcher-admin/ui/app/components/LocationList.js
2026-01-09 13:53:41 -06:00

28 lines
728 B
JavaScript

class LocationList extends Shadow {
list = []
render() {
VStack(() => {
this.list.forEach((update) => {
console.log(update.name)
HStack(() => {
p(update.timestamp)
p(update.name)
p(update.latitude)
p(update.longitude)
})
.gap(1, em)
})
})
.gap(0.5, em)
.paddingLeft(5, em)
.paddingTop(2, em)
.onEvent("update-location", (e) => {
console.log("location received: ", e.detail)
this.list.unshift(e.detail)
this.rerender()
})
}
}
window.register(LocationList)