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
574 B
TypeScript
24 lines
574 B
TypeScript
import IconButton from '@mui/joy/IconButton';
|
|
import Badge from '@mui/joy/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 color="neutral" aria-label={notificationsLabel(100)}>
|
|
<Badge badgeContent={100} badgeInset="-20%">
|
|
<MailIcon />
|
|
</Badge>
|
|
</IconButton>
|
|
);
|
|
}
|