Fix: Suchfeld Höhe reduziert, Roboter-Symbol aus TopBar entfernt (nicht Sidebar!), Sidebar-Eintrag wiederhergestellt, Lösch-Buttons funktionsfähig mit State, Badge-Zahl dynamisch

This commit is contained in:
Agent Zero
2026-07-19 23:50:37 +02:00
parent d1a40c18e6
commit 1d3b7a497b
3 changed files with 13 additions and 11 deletions
+11 -10
View File
@@ -20,6 +20,11 @@ export function TopBar() {
const [userMenuOpen, setUserMenuOpen] = useState(false);
const [notifOpen, setNotifOpen] = useState(false);
const [notifications, setNotifications] = useState([
'Neuer Kontakt hinzugefügt: Max Mustermann',
'Firma aktualisiert: TechCorp GmbH',
'Meeting um 14:00 Uhr mit Müller AG',
]);
const userRef = useRef<HTMLDivElement>(null);
const notifRef = useRef<HTMLDivElement>(null);
@@ -86,9 +91,6 @@ export function TopBar() {
</div>
<div className="flex items-center gap-2">
{/* AI Suggestions Badge */}
<SuggestionBadge onClick={openAISidebarProactive} />
{/* Notifications */}
<div ref={notifRef} className="relative">
<button
@@ -100,7 +102,7 @@ export function TopBar() {
<svg className="w-4 h-4 text-secondary-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
</svg>
<Badge variant="danger" className="absolute -top-1 -right-1 px-1.5 py-0">3</Badge>
<Badge variant="danger" className="absolute -top-1 -right-1 px-1.5 py-0">{notifications.length}</Badge>
</button>
{notifOpen && (
<div className="absolute top-full right-0 mt-1 w-80 bg-white rounded-md shadow-lg border border-secondary-200 z-50">
@@ -108,17 +110,16 @@ export function TopBar() {
<h3 className="text-sm font-semibold text-secondary-900">{t('topbar.notifications')}</h3>
</div>
<ul className="max-h-64 overflow-y-auto py-1" role="list">
{[
'Neuer Kontakt hinzugefügt: Max Mustermann',
'Firma aktualisiert: TechCorp GmbH',
'Meeting um 14:00 Uhr mit Müller AG',
].map((msg, i) => (
{notifications.length === 0 && (
<li className="px-4 py-3 text-sm text-secondary-400">Keine Benachrichtigungen</li>
)}
{notifications.map((msg, i) => (
<li key={i} className="flex items-center justify-between px-4 py-2 hover:bg-secondary-50 cursor-pointer text-sm text-secondary-700 group">
<span className="flex-1 truncate">{msg}</span>
<button
className="ml-2 p-1 rounded text-secondary-300 hover:text-danger-600 hover:bg-danger-50 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"
aria-label="Benachrichtigung löschen"
onClick={(e) => { e.stopPropagation(); }}
onClick={(e) => { e.stopPropagation(); setNotifications(prev => prev.filter((_, idx) => idx !== i)); }}
>
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />