All files / app/components NotificationBadge.tsx

100% Statements 8/8
100% Branches 0/0
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 321x 1x 1x   6x                     1x       12x   12x                    
import { Badge } from "@material-ui/core";
import React from "react";
import makeStyles from "utils/makeStyles";
 
const useStyles = makeStyles((theme) => ({
  badge: {
    right: "-0.8rem",
  },
}));
 
interface NotificationBadgeProps {
  children?: React.ReactNode;
  count?: number;
}
 
export default function NotificationBadge({
  children,
  count,
}: NotificationBadgeProps) {
  const classes = useStyles();
 
  return (
    <Badge
      badgeContent={count}
      classes={{ badge: classes.badge }}
      color="primary"
    >
      {children}
    </Badge>
  );
}