feat(ideas): voeg activeProductId-prop toe aan IdeaList
IdeaListProps uitgebreid met activeProductId: string | null. Create-form initialiseert en reset naar het actieve product na aanmaken. Tests en page.tsx bijgewerkt (page.tsx krijgt echte waarde in volgende taak). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3f40bc2f0f
commit
2150038066
3 changed files with 11 additions and 9 deletions
|
|
@ -65,6 +65,7 @@ interface IdeaListProps {
|
|||
ideas: IdeaDto[]
|
||||
products: ProductOption[]
|
||||
isDemo: boolean
|
||||
activeProductId: string | null
|
||||
}
|
||||
|
||||
const STATUS_FILTERS: { value: IdeaStatusApi; label: string }[] = [
|
||||
|
|
@ -119,7 +120,7 @@ function SortHeader({
|
|||
)
|
||||
}
|
||||
|
||||
export function IdeaList({ ideas, products, isDemo }: IdeaListProps) {
|
||||
export function IdeaList({ ideas, products, isDemo, activeProductId }: IdeaListProps) {
|
||||
const router = useRouter()
|
||||
const [isPending, startTransition] = useTransition()
|
||||
|
||||
|
|
@ -140,7 +141,7 @@ export function IdeaList({ ideas, products, isDemo }: IdeaListProps) {
|
|||
const [showCreate, setShowCreate] = useState(false)
|
||||
const [newTitle, setNewTitle] = useState('')
|
||||
const [newDescription, setNewDescription] = useState('')
|
||||
const [newProductId, setNewProductId] = useState<string>('')
|
||||
const [newProductId, setNewProductId] = useState<string>(activeProductId ?? '')
|
||||
|
||||
// Quick-idea form state
|
||||
const [showQuick, setShowQuick] = useState(false)
|
||||
|
|
@ -235,7 +236,7 @@ export function IdeaList({ ideas, products, isDemo }: IdeaListProps) {
|
|||
toast.success(`Idee aangemaakt (${r.data?.code})`)
|
||||
setNewTitle('')
|
||||
setNewDescription('')
|
||||
setNewProductId('')
|
||||
setNewProductId(activeProductId ?? '')
|
||||
setShowCreate(false)
|
||||
router.refresh()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue