Files
blockcatcher-admin/ui/app/components/LocationList.js
2025-10-31 21:54:57 -05:00

26 lines
684 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)
})
})
.onEvent("update-location", (e) => {
console.log("location received: ", e.detail)
this.list.unshift(e.detail)
this.rerender()
})
.x(2, em).y(5, em)
}
}
window.registerShadow(LocationList)