All files / src/features/Permissions/ModalV2/components MainHeader.tsx

60% Statements 3/5
100% Branches 0/0
33.33% Functions 1/3
60% Lines 3/5

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                    4x             27x                             27x            
import SidePanelHeaderVariant from "@shared/SidePanel/components/SidePanelHeader/SidePanelHeaderVariant";
 
type Props = {
  isFirst?: boolean;
  isLast?: boolean;
  setSelectedRow: (newIdx: string | number) => void;
  isLoading?: boolean;
  onClose: () => void;
};
 
const MainHeader = ({
  isFirst,
  isLast,
  setSelectedRow,
  isLoading,
  onClose,
}: Props) => {
  const headerProps = {
    actions: [],
    nextPrevState: {
      isFirst: Boolean(isFirst),
      isLast: Boolean(isLast),
    },
    handlers: {
      handleClose: onClose,
      handlePrevious: () => setSelectedRow("prev"),
      handleNext: () => setSelectedRow("next"),
      displayRowHandlers: true,
    } as any,
    isLoading: isLoading,
  };
 
  return (
    <SidePanelHeaderVariant variant="team_member" HeaderProps={headerProps} />
  );
};
 
export default MainHeader;