'use client' import { useTranslations } from 'next-intl' import { Dialog, DialogContent, DialogHeader, DialogTitle, } from '@/components/ui/dialog' import NewSupplierInvoiceForm from '@/components/supplier-invoices/NewSupplierInvoiceForm' interface Props { open: boolean onOpenChange: (open: boolean) => void /** Invoice-inbox item to convert; prefills the form from its AI extraction. */ inboxItemId?: string | null /** * Fired after a successful create. Hosts close the dialog and either * navigate to the invoice detail (id given) or refresh their list in place. */ onCreated: (invoiceId?: string) => void } /** * "Registrera leverantörsfaktura" as a modal: mirrors NewJournalEntryDialog. * Wraps the bare NewSupplierInvoiceForm; the form's own review/confirm, * supplier-create, bank-picker, and conflict dialogs stack on top of this one. */ export default function NewSupplierInvoiceDialog({ open, onOpenChange, inboxItemId, onCreated, }: Props) { const t = useTranslations('supplier_invoice_editor') return ( e.preventDefault()} onPointerDownOutside={(e) => e.preventDefault()} onInteractOutside={(e) => e.preventDefault()} > {t('page_title')} onOpenChange(false)} /> ) }