feat(dashboard): pencil-icoon edit-trigger op product-card (todo cmoq3ox51)
De dashboard product-card had al een 'Bewerken'-tekstknop, maar het patroon in de rest van de app (PBI/story/task in cards) is een hover-zichtbaar pencil-icoon. Vervangen voor consistentie. Product-detail page-header blijft tekst — daar staat 'Bewerken' tussen andere text-acties zoals "Sprint actief" en "Instellingen". Hergebruikt bestaande ProductDialog en setEditingProduct-state — geen wijziging aan de dialog of action zelf. Demo-block behouden. Tests: 4 nieuwe (rendert icoon, opent dialog, demo-disabled, geen icoon op archived). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9ffd0f06f2
commit
63f5231770
2 changed files with 62 additions and 5 deletions
|
|
@ -3,6 +3,7 @@
|
|||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useState, useTransition } from 'react'
|
||||
import { Pencil } from 'lucide-react'
|
||||
import { toast } from 'sonner'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
|
@ -106,14 +107,14 @@ export function ProductList({ products, isDemo, showArchived = false, activeProd
|
|||
{!showArchived && (
|
||||
<>
|
||||
<DemoTooltip show={isDemo}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
<button
|
||||
onClick={(e) => { e.stopPropagation(); if (!isDemo) setEditingProduct(product) }}
|
||||
className="opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-foreground p-0.5 rounded disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
aria-label="Bewerk product"
|
||||
disabled={isDemo}
|
||||
>
|
||||
Bewerken
|
||||
</Button>
|
||||
<Pencil size={14} />
|
||||
</button>
|
||||
</DemoTooltip>
|
||||
{product.id === activeProductId
|
||||
? <Badge className="bg-primary-container text-primary-container-foreground text-xs px-2 py-0">Actief</Badge>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue