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

100% Statements 9/9
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 30 31 32 33 34 35 361x   1x   1x                                 1x     6x   6x               1x  
import UserSummary from "components/UserSummary";
import { User } from "proto/api_pb";
import makeStyles from "utils/makeStyles";
 
const useStyles = makeStyles((theme) => ({
  friendItem: {
    padding: `0 ${theme.spacing(1)}`,
  },
  friendLink: {
    color: theme.palette.text.primary,
  },
  userLoadErrorAlert: {
    borderRadius: 0,
  },
}));
 
interface FriendSummaryViewProps {
  children?: React.ReactNode;
  friend?: User.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;