resolve issues with new features

This commit is contained in:
Matthias Hochmeister
2026-03-12 16:42:21 +01:00
parent 5aa309b97a
commit 68586b01dc
19 changed files with 526 additions and 109 deletions

View File

@@ -138,6 +138,15 @@ const NotificationBell: React.FC = () => {
}
};
const handleDeleteAllRead = async () => {
try {
await notificationsApi.deleteAllRead();
setNotifications((prev) => prev.filter((n) => !n.gelesen));
} catch {
// non-critical
}
};
const open = Boolean(anchorEl);
const hasUnread = unreadCount > 0;
@@ -169,11 +178,18 @@ const NotificationBell: React.FC = () => {
<Typography variant="subtitle1" fontWeight={600}>
Benachrichtigungen
</Typography>
{unreadCount > 0 && (
<Button size="small" onClick={handleMarkAllRead} sx={{ fontSize: '0.75rem' }}>
Alle als gelesen markieren
</Button>
)}
<Box sx={{ display: 'flex', gap: 0.5 }}>
{notifications.some((n) => n.gelesen) && (
<Button size="small" onClick={handleDeleteAllRead} sx={{ fontSize: '0.75rem' }}>
Gelesene löschen
</Button>
)}
{unreadCount > 0 && (
<Button size="small" onClick={handleMarkAllRead} sx={{ fontSize: '0.75rem' }}>
Alle als gelesen markieren
</Button>
)}
</Box>
</Box>
<Divider />