eletrotupi / tcc/ commit / 34e25ff

api/reports: fix type issue with annotations being possibly undefined

Pedro Lucas Porcellis porcellis@eletrotupi.com 29 days ago 34e25ffb8e40cae16e79671f45b4103c2cfef24f
Parents: a0a4482
1 file(s) changed
  • api/src/reports/ReportDocument.tsx +1 -1
api/src/reports/ReportDocument.tsx
1 1
import React from 'react'
2 2
import {
3 3
  Document,
4 4
  Page,
5 5
  View,
▸ 498 unchanged lines
504 504
                  format(entry.moment, 'd MMM', { locale: ptBR }),
505 505
                  T.moods[entry.mood] ?? entry.mood,
506 506
                  String(entry.anxietyLevel),
507 507
                  String(entry.stressLevel),
508 508
                  String(entry.energyLevel),
509 -
                  truncate(entry.annotation?.trim(), 73),
509 +
                  truncate(entry.annotation?.trim() ?? "", 73),
510 510
                ]}
511 511
                widths={[56, 78, 30, 30, 30, 75]}
512 512
                colors={[
513 513
                  undefined,
514 514
                  MOOD_COLORS[entry.mood],
▸ 12 unchanged lines
527 527
        )}
528 528
      </Page>
529 529
    </Document>
530 530
  )
531 531
}