/* * Copyright 2020-2021 AskChristee, LLC. All rights reserved. */ import { Document, Page, StyleSheet, Text, View, Image } from '@react-pdf/renderer'; import React from 'react'; import { TBuyWaitResponse, TBuyWaitResults, TResponseCoverPage } from '../../../../types/api'; import { PdfTextNoSpace } from '../../../atoms'; import ReportHeader from '../../../atoms/Pdf/ReportHeader'; import ReportTitle from '../../../atoms/Pdf/ReportTitle'; import UserInfo from '../../../atoms/Pdf/UserInfo'; import ReportClose from '../ClosingAcalc'; import logo from '../../../../images/christee-logo.png'; 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', }, logo: { width: 65, height: 15, position: 'absolute', bottom: 11, left: 65, }, copy: { fontSize: 9, position: 'absolute', bottom: 13, left: 10, }, }); const PdfReport: React.FC = ({ results }) => ( {results.aNotes && {results.aNotes.report_type}} {results.aNotes && {results.aNotes.report_type_2}} State {results.aNotes && {results.aNotes.state_sel}} {results.aNotes && {results.aNotes.state_select_2}} Selected Area {results.aNotes && {results.aNotes.area}} {results.aNotes && {results.aNotes.area_2}} Purchase Price (Note 1) {results.aNotes && ( )} {results.aNotes && ( )} Base Loan Amount (Note 2) {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 (Note 6) {results.aNotes && ( {results.aNotes.temp_cred}% )} {results.aNotes && ( {results.aNotes.temp_cred_2}% )} Required Cash (Note 4) {results.aNotes && ( )} {results.aNotes && ( )} Interest Rate (Note 7) {results.aNotes && {results.aNotes.temp_rate}%} {results.aNotes && {results.aNotes.temp_rate_2}%} Total Monthly Payment (Note 3) {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 (Note 9) {results.aNotes && ( )} {results.aNotes && ( )} Federal Tax Bracket (Note 10) {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 (Note 11) {results.aNotes && ( )} {results.aNotes && ( )} Front Ratio {results.aNotes && {results.aNotes.cal_fr}%} {results.aNotes && {results.aNotes.cal_fr_2}%} Back Ratio {results.aNotes && {results.aNotes.cal_br}%} {results.aNotes && {results.aNotes.cal_br_2}%} ); 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) && } Powered By `${pageNumber} / ${totalPages}`} fixed /> Powered By `${pageNumber} / ${totalPages}`} fixed /> ); interface Result { results: TBuyWaitResults; } interface Props { dat: TBuyWaitResponse; } const BuyWaitFinal: React.FC = ({ dat: { results, coverPage } }) => ( ); export default BuyWaitFinal;