Scrum4Me/components/shared/set-current-product.tsx
Janpeter Visser 3b5cee823c
Load/render workspace alignment (#182)
* docs: plan load render workspace alignment

* fix: normalize workspace status hydration

* fix: avoid duplicate backlog hydration load

* refactor: use sprint store active story

* refactor: migrate solo to workspace store

* chore: stabilize verification ignores
2026-05-10 07:34:58 +02:00

20 lines
737 B
TypeScript

'use client'
import { useEffect } from 'react'
import { useProductWorkspaceStore } from '@/stores/product-workspace/store'
import { debugProps } from '@/lib/debug'
// PBI-74 / T-853: workspace-store is nu enige bron voor active product.
// De voorganger (stores/product-store.ts) wordt in Story 8 (T-876) verwijderd.
export function SetCurrentProduct({ id, name }: { id: string; name: string }) {
useEffect(() => {
useProductWorkspaceStore
.getState()
.setActiveProduct({ id, name }, { load: false, preserveSelection: true })
return () => {
useProductWorkspaceStore.getState().setActiveProduct(null, { load: false })
}
}, [id, name])
return <span {...debugProps('set-current-product')} hidden />
}