All files / src/features/GiveConversation/sections BodySelector.tsx

83.33% Statements 5/6
50% Branches 4/8
100% Functions 1/1
83.33% Lines 5/6

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              42x   40x   17x     21x     2x                                        
import MessageThread from "../components/MessageThread";
import { useConversationContext } from "../ConversationProvider";
import { GiveConversationSections } from "../constants";
import Threads from "../components/Threads";
import GiveEmptyStateWrapper from "@shared/EmptyState/GiveEmptyStateWrapper";
 
function BodySelector() {
  const { sectionInView, currentThread, tab } = useConversationContext();
 
  switch (sectionInView) {
    case GiveConversationSections.MESSAGE_CHATS:
      return <MessageThread />;
 
    case GiveConversationSections.MESSAGE_LIST:
      return <Threads />;
 
    case GiveConversationSections.MESSAGE_NEW:
      return currentThread?.taskID ? (
        <GiveEmptyStateWrapper
          section={
            tab === "team"
              ? "no-team-conversations"
              : "no-merchant-conversations"
          }
          isEmpty
        />
      ) : (
        <></>
      );
 
    default:
      return <>nothing to show</>;
  }
}
 
export default BodySelector;
// GiveConversationSections