feat(PBI-98/T-1091): ProductDialog cross-link "Naar docs-instellingen"
Edit-mode-only cross-link in de dialog-footer naar /products/[id]/docs/ settings. Layout: footer is nu flex justify-between met de link links en de bestaande knoppen (Annuleren + Opslaan) rechts. Create-mode behoudt right-aligned knoppen via placeholder-span. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2c6d356acf
commit
a6fcfe685a
1 changed files with 27 additions and 13 deletions
|
|
@ -1,6 +1,7 @@
|
|||
'use client'
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { useForm, useWatch } from 'react-hook-form'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { toast } from 'sonner'
|
||||
|
|
@ -287,20 +288,33 @@ export function ProductDialog(props: Props) {
|
|||
</form>
|
||||
|
||||
<div className={entityDialogFooterClasses}>
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={closeGuard.attemptClose}
|
||||
disabled={isPending}
|
||||
>
|
||||
Annuleren
|
||||
</Button>
|
||||
<DemoTooltip show={isDemo}>
|
||||
<Button type="submit" form="product-form" disabled={isPending || isDemo} data-debug-id="product-dialog__submit">
|
||||
{isPending ? '…' : mode === 'edit' ? 'Opslaan' : 'Aanmaken'}
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
{mode === 'edit' && product?.id ? (
|
||||
<Link
|
||||
href={`/products/${product.id}/docs/settings`}
|
||||
className="text-xs text-primary hover:underline inline-flex items-center gap-1"
|
||||
data-debug-id="product-dialog__docs-settings-link"
|
||||
>
|
||||
Naar docs-instellingen →
|
||||
</Link>
|
||||
) : (
|
||||
<span />
|
||||
)}
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={closeGuard.attemptClose}
|
||||
disabled={isPending}
|
||||
>
|
||||
Annuleren
|
||||
</Button>
|
||||
</DemoTooltip>
|
||||
<DemoTooltip show={isDemo}>
|
||||
<Button type="submit" form="product-form" disabled={isPending || isDemo} data-debug-id="product-dialog__submit">
|
||||
{isPending ? '…' : mode === 'edit' ? 'Opslaan' : 'Aanmaken'}
|
||||
</Button>
|
||||
</DemoTooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue