mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2026-05-08 09:38:55 -04:00
3ac6e4d5b8
- Upgrade Next.js and related packages for improved performance and security - Refactor invoice-related pages to streamline navigation and enhance user experience - Consolidate invoice editing and viewing functionality into a single page - Remove deprecated edit page and implement a new view page for invoices - Update links and routing for consistency across the dashboard
27 lines
666 B
TypeScript
27 lines
666 B
TypeScript
"use client";
|
|
|
|
import { InvoiceView } from "~/components/data/invoice-view";
|
|
import InvoiceForm from "~/components/forms/invoice-form";
|
|
|
|
interface UnifiedInvoicePageProps {
|
|
invoiceId: string;
|
|
mode: string;
|
|
}
|
|
|
|
export function UnifiedInvoicePage({
|
|
invoiceId,
|
|
mode,
|
|
}: UnifiedInvoicePageProps) {
|
|
return (
|
|
<div>
|
|
{/* Always render InvoiceForm to preserve state, but hide when in view mode */}
|
|
<div className={mode === "edit" ? "block" : "hidden"}>
|
|
<InvoiceForm invoiceId={invoiceId} />
|
|
</div>
|
|
|
|
{/* Show InvoiceView only when in view mode */}
|
|
{mode === "view" && <InvoiceView invoiceId={invoiceId} />}
|
|
</div>
|
|
);
|
|
}
|