All files / src/features/Merchants/MerchantSidePanel/Modals/PreviewInvitationModal/components PreviewInvitationModalHeader.tsx

100% Statements 3/3
100% Branches 11/11
100% Functions 1/1
100% Lines 3/3

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 31 32 33 34 35 36                    1x           11x     11x                                
import { Image } from "@common/StyledImage/Image";
import { Box } from "@mui/material";
import { GiveCorporationLogo } from "@assets/icons/RebrandedIcons";
import GiveText from "@shared/Text/GiveText";
 
type Props = {
  senderName?: string;
  senderLogo?: string;
  isSendingToProvider: boolean;
};
const PreviewInvitationModalHeader = ({
  senderName = "",
  senderLogo,
  isSendingToProvider,
}: Props) => {
  const imgSrc =
    senderLogo?.slice(-5).toLowerCase() === "thumb"
      ? senderLogo
      : `${senderLogo}/original`;
  return (
    <Box>
      {senderLogo && !isSendingToProvider ? (
        <Image alt={senderName} src={imgSrc} width="94px" height="94px" />
      ) : senderName && !isSendingToProvider ? (
        <GiveText>{senderName}</GiveText>
      ) : (
        <Box>
          <GiveCorporationLogo />
        </Box>
      )}
    </Box>
  );
};
 
export default PreviewInvitationModalHeader;