All files / src/features/Minibuilders/Conversations/Modal/Sections CreateTopicButton.tsx

100% Statements 2/2
62.5% Branches 5/8
100% Functions 1/1
100% Lines 2/2

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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55            21x                         11x                                                                      
import { PlusIcon } from "@assets/icons";
import { Button } from "@common/Button";
import { Text } from "@common/Text";
import { SxProps } from "@mui/material";
import { Box } from "@mui/material";
 
const CreateTopicButton = ({
  handleOpenTopicModal,
  isInternalConversations,
  buttonText,
  sx,
  isEnterprise,
}: {
  handleOpenTopicModal: () => void;
  isInternalConversations?: boolean;
  sx?: SxProps;
  buttonText?: string;
  isEnterprise?: boolean;
}) => {
  return (
    <Box
      sx={{
        paddingBottom: 3,
        position: "absolute",
        bottom: 0,
        left: "50%",
        transform: `translateX(-50%)`,
        paddingTop: 3,
        margin: "0 auto",
        ...sx,
      }}
    >
      <Button
        onClick={handleOpenTopicModal}
        endIcon={
          isInternalConversations && (
            <PlusIcon width={18} height={18} fill="#fff" />
          )
        }
        size="medium"
        data-testid="new-topic-button"
      >
        <Text sx={{ fontWeight: 400 }}>
          {buttonText ||
            (isInternalConversations
              ? "New topic"
              : `Notify ${isEnterprise ? "Provider" : "Merchant"} `)}
        </Text>
      </Button>
    </Box>
  );
};
 
export default CreateTopicButton;