All files / src/sections/PayBuilder/components/EmailPreview EmailPreviewController.tsx

6.66% Statements 1/15
0% Branches 0/12
0% Functions 0/1
11.11% Lines 1/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                12x                                          
import { FundraiserEmailPreview } from "../fundraiser-preview-email/FundraiserPreviewEmail";
import useCheckFormType from "../hooks/useCheckFormType";
import ProductEmailPreview from "../product-preview-email/ProductEmailPreview";
import EventEmailPreview from "./Event/EventEmailPreview";
import { SweepstakeEmailPreview } from "../sweepstake-preview-email/SweepstakeEmailPreview";
import MembershipEmailPreview from "./Membership/MembershipEmailPreview";
import InvoiceEmailPreview from "../InvoicePreview/EmailPreview";
 
const EmailPreviewController = (props: { from: string }) => {
  const {
    isProduct,
    isEvent,
    isMembership,
    isSweepstake,
    isFundraiser,
    isInvoice,
  } = useCheckFormType();
 
  if (isProduct) return <ProductEmailPreview />;
  if (isEvent) return <EventEmailPreview />;
  if (isMembership) return <MembershipEmailPreview />;
  if (isFundraiser) return <FundraiserEmailPreview />;
  if (isSweepstake) return <SweepstakeEmailPreview />;
  if (isInvoice) return <InvoiceEmailPreview {...props} />;
 
  return null;
};
 
export default EmailPreviewController;