Scrum4Me/components/dashboard/new-product-button.tsx
Scrum4Me Agent e8537cc3f1 feat(PBI-49): add BEM sub-element data-debug-id to new-product-button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 22:06:02 +02:00

26 lines
795 B
TypeScript

'use client'
import { useState } from 'react'
import { useRouter } from 'next/navigation'
import { Button } from '@/components/ui/button'
import { ProductDialog } from '@/components/dialogs/product-dialog'
import { debugProps } from '@/lib/debug'
export function NewProductButton() {
const [open, setOpen] = useState(false)
const router = useRouter()
return (
<>
<div {...debugProps('new-product-button', 'NewProductButton', 'components/dashboard/new-product-button.tsx')}>
<Button onClick={() => setOpen(true)} data-debug-id="new-product-button__trigger">+ Nieuw product</Button>
</div>
<ProductDialog
mode="create"
open={open}
onOpenChange={setOpen}
onSaved={(id) => router.push(`/products/${id}`)}
/>
</>
)
}