}>()(Component) {
#componentSnap = makePlanningComponentSnap()
get #storeModel() { return this.share.storeModel }
#planningUi = planningUi({
storeModel: this.#storeModel,
componentSnap: this.#componentSnap,
getShadowRoot: () => this.shadowRoot,
})
async init() {
this.addSubscription(
() => this
.#componentSnap
.subscribe(() => this.requestUpdate())
)
await this
.#storeModel
.initialize()
}
render() {
const {snap, allowance} = this.#storeModel
const state = snap.readable
const connectStatus = ops.value(state.stripeConnect.connectStatusOp)
return html`
${connectStatus === StripeConnectStatus.Ready
? allowance.manageStore
? this.#planningUi.renderPlanning()
: html`your account does not have permissions to manage the store
`
: html`store is not active
`}
`
}
}