diff --git a/src/components/InvoicePreview.vue b/src/components/InvoicePreview.vue index d729ba8..90dc8d8 100644 --- a/src/components/InvoicePreview.vue +++ b/src/components/InvoicePreview.vue @@ -21,703 +21,1554 @@ const sampleItems: InvoiceItem[] = [ { description: 'Project Management', quantity: 12, rate: 100, amount: 1200 }, ] -const displayItems = computed(() => - props.items.length > 0 ? props.items : sampleItems, -) - -const config = computed(() => props.template) - -const clientName = computed(() => props.client?.name || 'N/A') +const displayItems = computed(() => props.items.length > 0 ? props.items : sampleItems) +const c = computed(() => props.template.colors) +const clientName = computed(() => props.client?.name || 'Client Name') const clientEmail = computed(() => props.client?.email || '') -const clientAddressLines = computed(() => - props.client?.address ? props.client.address.split('\n') : [], -) - +const clientCompany = computed(() => props.client?.company || '') +const clientAddress = computed(() => props.client?.address || '') +const clientAddressLines = computed(() => props.client?.address ? props.client.address.split('\n') : []) const biz = computed(() => props.businessInfo) -const bizAddressLines = computed(() => - biz.value?.address ? biz.value.address.split('\n') : [], -) +const bizAddressLines = computed(() => biz.value?.address ? biz.value.address.split('\n') : []) -const numberFont = computed(() => - config.value.typography.numberStyle === 'monospace-feel' - ? "'Courier New', Courier, monospace" - : 'inherit', -) - -const sideOffset = computed(() => - config.value.layout.headerStyle === 'sidebar' - ? `${config.value.decorative.sidebarWidth + 6}%` - : '0px', -) - -// Divider style helper -const dividerBorder = computed(() => { - if (!config.value.layout.showDividers || config.value.layout.dividerStyle === 'none') return 'none' - switch (config.value.layout.dividerStyle) { - case 'thin': return `1px solid ${config.value.colors.tableBorder}` - case 'double': return `3px double ${config.value.colors.tableBorder}` - case 'thick': return `2px solid ${config.value.colors.primary}` - default: return 'none' - } -}) - -const showDivider = computed(() => - config.value.layout.showDividers && config.value.layout.dividerStyle !== 'none', -) - -// Logo position style -const logoContainerStyle = computed(() => { - const pos = config.value.layout.logoPosition - const base: Record = { marginBottom: '2%' } - if (pos === 'top-center') base.textAlign = 'center' - else if (pos === 'top-right') base.textAlign = 'right' - else base.textAlign = 'left' - return base -}) +void clientAddress