app/(app)/ideas/page.tsx (server-component): - user_id-only fetch (no productAccessFilter — Idee is privé) - products fetched with productAccessFilter for filter-dropdown + create-form components/ideas/idea-list.tsx (client-component): - Search by title, product-dropdown filter, status multi-chip filter - Inline create form with title/description/product (optional) - Native shadcn Table + status badge via getIdeaStatusBadge (T-509) - Row click navigates to /ideas/[id] - Sonner toasts for success/error; router.refresh() after mutations - DemoTooltip + disabled on Nieuw + Archive - Empty-state + filtered-empty messaging components/ideas/idea-row-actions.tsx (placeholder for T-508): - "Open" navigation + "Archive" button only — Grill / Make Plan / Materialiseer come in T-508 with full disabled-rules Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
'use client'
|
|
|
|
// IdeaRowActions — placeholder shell voor M12 T-507. De volledige
|
|
// disabled-rules + Grill/Make-Plan/Materialiseer-knoppen komen in T-508.
|
|
//
|
|
// Voor nu: alleen een "Open" link en een Archive-knop, zodat de lijst
|
|
// compileert en navigatie + archief al werken.
|
|
|
|
import { useRouter } from 'next/navigation'
|
|
import { Archive, ArrowRight } from 'lucide-react'
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
import { DemoTooltip } from '@/components/shared/demo-tooltip'
|
|
import type { IdeaDto } from '@/lib/idea-dto'
|
|
|
|
interface IdeaRowActionsProps {
|
|
idea: IdeaDto
|
|
isDemo: boolean
|
|
onArchive: () => void
|
|
}
|
|
|
|
export function IdeaRowActions({ idea, isDemo, onArchive }: IdeaRowActionsProps) {
|
|
const router = useRouter()
|
|
|
|
return (
|
|
<div className="flex items-center gap-1.5">
|
|
<Button
|
|
size="sm"
|
|
variant="outline"
|
|
onClick={() => router.push(`/ideas/${idea.id}`)}
|
|
>
|
|
Open
|
|
<ArrowRight className="ml-1 size-3.5" />
|
|
</Button>
|
|
<DemoTooltip show={isDemo}>
|
|
<Button
|
|
size="sm"
|
|
variant="ghost"
|
|
onClick={onArchive}
|
|
disabled={isDemo}
|
|
aria-label="Archiveer idee"
|
|
title="Archiveer"
|
|
>
|
|
<Archive className="size-4" />
|
|
</Button>
|
|
</DemoTooltip>
|
|
</div>
|
|
)
|
|
}
|