All files / app/features/connections/friends FriendSummaryView.tsx

100% Statements 10/10
50% Branches 1/2
100% Functions 2/2
100% Lines 7/7

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 301x   1x   1x                     2x     2x   2x               2x  
import UserSummary from "components/UserSummary";
import { LiteUser } from "proto/api_pb";
import makeStyles from "utils/makeStyles";
 
const useStyles = makeStyles((theme) => ({
  friendItem: {
    padding: `0 ${theme.spacing(1)}`,
  },
}));
 
interface FriendSummaryViewProps {
  children?: React.ReactNode;
  friend?: LiteUser.AsObject;
}
 
export const FRIEND_ITEM_TEST_ID = "friend-item";
 
function FriendSummaryView({ children, friend }: FriendSummaryViewProps) {
  const classes = useStyles();
 
  return friend ? (
    <div className={classes.friendItem} data-testid={FRIEND_ITEM_TEST_ID}>
      <UserSummary headlineComponent="h3" user={friend} />
      {children}
    </div>
  ) : null;
}
 
export default FriendSummaryView;