add setAction/clearAction to sidebar store for dynamic header buttons

This commit is contained in:
Justin Edmund 2025-12-02 17:19:34 -08:00
parent cc2b2c1f95
commit 000cfd2332

View file

@ -99,6 +99,24 @@ class SidebarStore {
}
}
/** Update the right accessory action button dynamically */
setAction(
onsave: (() => void) | undefined,
saveLabel?: string,
element?: 'wind' | 'fire' | 'water' | 'earth' | 'dark' | 'light'
) {
this.state.onsave = onsave
this.state.saveLabel = saveLabel
this.state.element = element
}
/** Clear the right accessory action button */
clearAction() {
this.state.onsave = undefined
this.state.saveLabel = undefined
this.state.element = undefined
}
get isOpen() {
return this.state.open
}