Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
24 lines
568 B
TypeScript
24 lines
568 B
TypeScript
import IconButton from '@mui/material/IconButton';
|
|
import Badge from '@mui/material/Badge';
|
|
import MailIcon from '@mui/icons-material/Mail';
|
|
|
|
function notificationsLabel(count: number) {
|
|
if (count === 0) {
|
|
return 'no notifications';
|
|
}
|
|
if (count > 99) {
|
|
return 'more than 99 notifications';
|
|
}
|
|
return `${count} notifications`;
|
|
}
|
|
|
|
export default function AccessibleBadges() {
|
|
return (
|
|
<IconButton aria-label={notificationsLabel(100)}>
|
|
<Badge badgeContent={100} color="secondary">
|
|
<MailIcon />
|
|
</Badge>
|
|
</IconButton>
|
|
);
|
|
}
|