Scrum4Me/components/shared/set-current-product.tsx
Scrum4Me Agent f555cb547b refactor(PBI-49): migrate 17 shared/ components to debugProps helper
Replace hardcoded data-debug-id + data-debug-label attribute pairs with
{...debugProps(id, component, file)} spread in all 17 components/shared/
files. Existing debug-ids preserved unchanged.
2026-05-09 20:47:51 +02:00

16 lines
569 B
TypeScript

'use client'
import { useEffect } from 'react'
import { useProductStore } from '@/stores/product-store'
import { debugProps } from '@/lib/debug'
export function SetCurrentProduct({ id, name }: { id: string; name: string }) {
const { setCurrentProduct, clearCurrentProduct } = useProductStore()
useEffect(() => {
setCurrentProduct(id, name)
return () => clearCurrentProduct()
}, [id, name, setCurrentProduct, clearCurrentProduct])
return <span {...debugProps('set-current-product', 'SetCurrentProduct', 'shared/set-current-product.tsx')} hidden />
}