diff --git a/app/(app)/invoices/page.tsx b/app/(app)/invoices/page.tsx index 77cc8b6..6be0257 100644 --- a/app/(app)/invoices/page.tsx +++ b/app/(app)/invoices/page.tsx @@ -154,7 +154,20 @@ export default function InvoicesPage() { {/* Invoice Detail Modal */} - setSelected(null)} title={`Invoice ${selected?.invoiceNumber ?? ""}`} className="max-w-lg"> + setSelected(null)} + title={`Invoice ${selected?.invoiceNumber ?? ""}`} + className="max-w-lg" + footer={selected ? ( + <> + {selected.status !== "VOID" && selected.status !== "PAID" && ( + + )} + + + ) : undefined} + > {selected && (
@@ -196,13 +209,6 @@ export default function InvoicesPage() { disabled={!payForm.amount}>Record Payment
)} - -
- {selected.status !== "VOID" && selected.status !== "PAID" && ( - - )} - -
)}
diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 7713723..1ce1456 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -9,10 +9,11 @@ interface ModalProps { onClose: () => void; title: string; children: React.ReactNode; + footer?: React.ReactNode; className?: string; } -export function Modal({ isOpen, onClose, title, children, className }: ModalProps) { +export function Modal({ isOpen, onClose, title, children, footer, className }: ModalProps) { const overlayRef = useRef(null); useEffect(() => { @@ -31,8 +32,8 @@ export function Modal({ isOpen, onClose, title, children, className }: ModalProp className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4" onClick={(e) => e.target === overlayRef.current && onClose()} > -
-
+
+

{title}

-
{children}
+
{children}
+ {footer && ( +
+ {footer} +
+ )}
);