/* * Copyright 2020-2021 AskChristee, LLC. All rights reserved. */ import { Document, Page, StyleSheet, Text, View } from '@react-pdf/renderer'; import React from 'react'; import { TBuyWaitResponse, TBuyWaitResults, TResponseCoverPage } from '../../../../types/api'; import { PdfReportLogo, PdfTextNoSpace } from '../../../atoms'; import ReportTitle from '../../../atoms/Pdf/ReportTitle'; import UserInfo from '../../../atoms/Pdf/UserInfo'; import ReportClose from '../ClosingAcalc'; const styles = StyleSheet.create({ body: { // fontFamily: 'Roboto', paddingTop: 10, paddingBottom: 25, paddingHorizontal: 30, }, pageNumber: { position: 'absolute', fontSize: 9, bottom: 15, left: 0, right: 0, textAlign: 'center', color: 'black', }, image: { width: 70, height: 20, }, header: { fontSize: 12, marginBottom: 20, textAlign: 'center', color: 'grey', }, textbold: { // fontFamily: 'RobotoBold', fontWeight: 900, fontSize: 9, }, description: { textAlign: 'left', width: '50%', fontSize: 9, }, description2: { textAlign: 'left', width: '100%', fontSize: 9, }, tableContainer: { flexDirection: 'row', flexWrap: 'wrap', marginTop: 10, }, row: { flexDirection: 'row', alignItems: 'center', height: 16, }, acalc: { width: '30%', fontSize: 9, textAlign: 'left', }, }); const PdfReport: React.FC = ({ results }) => ( {results.aNotes && {results.aNotes.pdf_mess13}} {results.aCalc.brow_head} {results.aCalc.brow_head_2} Report Type {results.aNotes && {results.aNotes.report_type}} {results.aNotes && {results.aNotes.report_type_2}} Purchase Price {results.aNotes && ( )} {results.aNotes && ( )} Base Loan Amount {results.aNotes && ( )} {results.aNotes && ( )} Total Loan Amount {results.aNotes && ( )} {results.aNotes && ( )} Down Payment {results.aNotes && ( )} {results.aNotes && ( )} Total Closing Cost {results.aNotes && ( )} {results.aNotes && ( )} Seller Paid Cost {results.aNotes && ( {results.aNotes.temp_cred}% )} {results.aNotes && ( {results.aNotes.temp_cred_2}% )} Required Cash {results.aNotes && ( )} {results.aNotes && ( )} Interest Rate {results.aNotes && {results.aNotes.temp_rate}%} {results.aNotes && {results.aNotes.temp_rate_2}%} Total Monthly Payment {results.aNotes && ( )} {results.aNotes && ( )} Principal & Interest {results.aNotes && ( )} {results.aNotes && ( )} Monthly Mortgage Insurance {results.aNotes && ( )} {results.aNotes && ( )} Monthly Property Taxes {results.aNotes && ( )} {results.aNotes && ( )} Monthly Property Insurance {results.aNotes && ( )} {results.aNotes && ( )} Monthly Condo/HOA Fee {results.aNotes && ( )} {results.aNotes && ( )} Estimated Annual Tax Deduction {results.aNotes && ( )} {results.aNotes && ( )} Federal Tax Bracket {results.aNotes && {results.aNotes.print_t_bracket}%} {results.aNotes && {results.aNotes.print_t_bracket}%} Monthly Federal Tax Savings {results.aNotes && ( )} {results.aNotes && ( )} Net Monthly Mortgage Payment {results.aNotes && ( )} {results.aNotes && ( )} Potential Equity {results.aNotes && ( )} {results.aNotes && ( )} ); const PdfReportMessage: React.FC = ({ results }) => ( {results.aNotes && {results.aNotes.pdfmess}} {results.aNotes && {results.aNotes.pdf_head1}} {results.aNotes && {results.aNotes.pdf_head2}} {results.aNotes && ( {results.aNotes.pdfmess1} {results.aNotes.pdfmess2} )} {results.aNotes && ( {results.aNotes.pdfmess3} {results.aNotes.pdfmess4} )} {results.aNotes && ( {results.aNotes.pdfmess5} {results.aNotes.pdfmess6} )} {results.aNotes && ( {results.aNotes.pdfmess7} {results.aNotes.pdfmess8} )} {results.aNotes && ( {results.aNotes.pdfmess9} {results.aNotes.pdfmess10} )} {results.aNotes && ( {results.aNotes.pdfmess11} {results.aNotes.pdfmess12} )} {results.aNotes && {results.aNotes.pdf_mess14}} {results.aNotes && {results.aNotes.pdf_mess15}} ); type BuyWaitPdfProps = { results: TBuyWaitResults; coverPage: TResponseCoverPage; }; const BuyWaitPdf: React.FC = ({ results, coverPage }) => ( <> {!!(coverPage.name && coverPage.email) && } `${pageNumber} / ${totalPages}`} fixed /> `${pageNumber} / ${totalPages}`} fixed /> ); interface Result { results: TBuyWaitResults; } interface Props { dat: TBuyWaitResponse; } const BuyWaitFinal: React.FC = ({ dat: { results, coverPage } }) => ( ); export default BuyWaitFinal;