/* * Copyright 2020-2021 AskChristee, LLC. All rights reserved. */ import { Document, Page, StyleSheet, Text, View, Image } from '@react-pdf/renderer'; import React, { Fragment } from 'react'; import { TInvestmentAClose, TInvestmentPDF, TInvestmentResponse, TResponseCoverPage } from '../../../../types/api'; import { PdfCash, PdfCashPrompt, PdfCashPromptWithPercent, PdfPercentPrompt, PdfPromptCashPercentParens } from '../../../atoms'; import ReportHeader from '../../../atoms/Pdf/ReportHeader'; import UserInfo from '../../../atoms/Pdf/UserInfo'; import ReportClose from '../ClosingAcalc'; import logo from '../../../../images/christee-logo.png'; const headerStyles = StyleSheet.create({ titleContainer: { flexDirection: 'row', marginTop: 10, marginBottom: 5, }, reportTitle: { color: '#000000', fontSize: 12, }, }); interface TitleProps { title: string; } const ReportTitle: React.FC = ({ title }) => ( {title} ); 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: '100%', fontSize: 9, }, tableContainer: { flexDirection: 'row', flexWrap: 'wrap', marginTop: 10, }, row: { flexDirection: 'row', alignItems: 'center', height: 16, }, logo: { width: 65, height: 15, position: 'absolute', bottom: 11, left: 65, }, copy: { fontSize: 9, position: 'absolute', bottom: 13, left: 10, }, }); function SectionHeader(pdf: TInvestmentPDF) { return ( {pdf.pdfmess1}  State: {pdf.state_sel}  Selected Area: {pdf.area} {pdf.pdf_head1} {pdf.pdf_head2} ); } function SectionOne(pdf: TInvestmentPDF) { return ( 1. Purchase Details  ); } function SectionTwo(pdf: TInvestmentPDF) { return ( 2. Mortgage Details  {pdf.pdfmess2} (Annual Mortgage Payment) ); } function SectionThree(pdf: TInvestmentPDF) { return ( 3. Annual Income Analysis  for {pdf.report_years} years ({pdf.vac_allow}%)  ({pdf.prop_mgt}%)    {pdf.cash_flow_$} Cash Flow  Average {pdf.tax_sit}    {pdf.tax_due$}  ); } function SectionFour(pdf: TInvestmentPDF) { return ( 4. Projected Future Value  Report Period {pdf.report_years} Years. Appreciation Rate  {pdf.prop_app}% Annually (Value Minus Loan Balance) {pdf.cash_$}  {pdf.cash_imp} ); } function SectionFive(pdf: TInvestmentPDF) { return ( 5. Deprecation Details  For Report Period ({pdf.st_depre} years) ({pdf.cost_seg_period} years) ); } function SectionSix(pdf: TInvestmentPDF) { return ( 6. Potential Tax Overview  ); } function SectionSeven(pdf: TInvestmentPDF) { return ( 7. Ratios  Debt Service Ratio {pdf.dscr} Gross Rent Multiplier {pdf.grm_factor} Return of Capital {pdf.return_invest} years ); } function SectionFooter(pdf: TInvestmentPDF) { return ( {pdf.pdf_bottom} ); } const ReportContainer: React.FC = ({ pdf, aClose, coverPage }) => { return ( {!!(coverPage.name && coverPage.email) && } Powered By `${pageNumber} / ${totalPages}`} fixed /> Powered By `${pageNumber} / ${totalPages}`} fixed /> ); }; /** * This is the exported function it takes the and * title from pdf.button. */ interface InvestPdf { pdf: TInvestmentPDF; aClose: TInvestmentAClose; coverPage: TResponseCoverPage; } interface Props { dat: TInvestmentResponse; } const PdfReport: React.FC = ({ dat: { pdf, aClose, coverPage } }) => { return ( ); }; export default PdfReport;