-
-
-
-
- {previewLoading ? (
-
-
-
- ) : previewData?.url ? (
-
- ) : (
-
-
Unable to load PDF preview
-
- )}
-
- );
-}
diff --git a/src/lib/pdf/templates/invoice-template.ts b/src/lib/pdf/templates/invoice-template.ts
deleted file mode 100644
index 06b7394d..00000000
--- a/src/lib/pdf/templates/invoice-template.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-import type { Template } from '@pdfme/common';
-
-import { formatCurrency } from '@/lib/utils/currency';
-
-export const invoiceTemplate: Template = {
- basePdf: 'BLANK_PDF' as unknown as string,
- schemas: [
- [
- // Header fields
- {
- name: 'portName',
- type: 'text',
- position: { x: 20, y: 15 },
- width: 100,
- height: 10,
- fontSize: 16,
- },
- {
- name: 'invoiceTitle',
- type: 'text',
- position: { x: 140, y: 15 },
- width: 50,
- height: 10,
- fontSize: 16,
- },
- {
- name: 'invoiceNumber',
- type: 'text',
- position: { x: 140, y: 27 },
- width: 50,
- height: 6,
- fontSize: 10,
- },
- {
- name: 'invoiceDate',
- type: 'text',
- position: { x: 140, y: 35 },
- width: 50,
- height: 6,
- fontSize: 10,
- },
- {
- name: 'dueDate',
- type: 'text',
- position: { x: 140, y: 43 },
- width: 50,
- height: 6,
- fontSize: 10,
- },
- // Client info
- {
- name: 'clientInfo',
- type: 'text',
- position: { x: 20, y: 55 },
- width: 100,
- height: 20,
- fontSize: 10,
- },
- // Line items as text block
- {
- name: 'lineItems',
- type: 'text',
- position: { x: 20, y: 85 },
- width: 170,
- height: 120,
- fontSize: 9,
- },
- // Totals
- {
- name: 'totals',
- type: 'text',
- position: { x: 110, y: 215 },
- width: 80,
- height: 30,
- fontSize: 10,
- },
- // Notes
- {
- name: 'notes',
- type: 'text',
- position: { x: 20, y: 250 },
- width: 170,
- height: 20,
- fontSize: 8,
- },
- ],
- ],
-};
-
-export function buildInvoiceInputs(
- invoice: Record