瀏覽代碼

fixed html tags in qoute description (#31)

Bernt Christian Egeland 7 月之前
父節點
當前提交
de0a1f0030

+ 2 - 1
src/features/quotes/Components/QuotePDF.tsx

@@ -1,6 +1,7 @@
 import { Document, Page, Text, View, Image } from '@react-pdf/renderer'
 import { formatCurrency, formatDateForPdf, DEFAULT_DATE_FORMAT } from '@/lib/format'
 import { createStyles, gray, getFontBold } from '@/features/vehicles/Components/invoice-pdf/styles'
+import { HtmlToPdf } from '@/features/vehicles/Components/invoice-pdf/Notes'
 import type { TemplateConfig } from '@/features/vehicles/Components/invoice-pdf/types'
 
 function fillTemplate(template: string, values: Record<string, string>): string {
@@ -481,7 +482,7 @@ export function QuotePDF({
         {data.description && (
           <View style={styles.notesSection}>
             <Text style={styles.notesLabel}>Description</Text>
-            <Text style={styles.notesText}>{data.description}</Text>
+            <HtmlToPdf html={data.description} baseStyle={styles.notesText} fontBold={fontBold} />
           </View>
         )}
 

+ 1 - 1
src/features/vehicles/Components/invoice-pdf/Notes.tsx

@@ -78,7 +78,7 @@ function buildAST(tokens: Token[]): (ASTNode | string)[] {
   return root
 }
 
-function HtmlToPdf({
+export function HtmlToPdf({
   html,
   baseStyle,
   fontBold,