Team-API, Sidebar-Zaehler und Format-Hilfen fuer Gutschriften, Angebote und E-Mail-Speicher
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
813c6a7e18
commit
91d526e909
13 files changed
+487
-47
No files matched your search
@@ -17,12 +17,15 @@ import {
|
||||
IconLayoutSidebarLeftExpand,
|
||||
IconExternalLink,
|
||||
IconMessages,
|
||||
IconReceiptRefund,
|
||||
IconDiscount,
|
||||
IconMailCog,
|
||||
} from '@tabler/icons-react'
|
||||
import { openProjectAdmin } from '../lib/employeeAdminApi'
|
||||
import { serverpulsApi } from '../lib/serverpulsApi'
|
||||
import { startsCollapsed } from '../lib/sidebar'
|
||||
import { buildNavLinks } from '../lib/navLinks'
|
||||
import { useChatUnread } from '../hooks/useChatUnread'
|
||||
import { useSidebarCounts } from '../hooks/useSidebarCounts'
|
||||
|
||||
const ICONS = {
|
||||
tickets: <IconTicket />,
|
||||
@@ -31,6 +34,9 @@ const ICONS = {
|
||||
services: <IconLayoutGrid />,
|
||||
customers: <IconUsers />,
|
||||
chat: <IconMessages />,
|
||||
gutschriften: <IconReceiptRefund />,
|
||||
angebote: <IconDiscount />,
|
||||
speicher: <IconMailCog />,
|
||||
leads: <IconTargetArrow />,
|
||||
finance: <IconReportMoney />,
|
||||
legal: <IconScale />,
|
||||
@@ -45,7 +51,7 @@ export default function Sidebar() {
|
||||
const [collapsed, setCollapsed] = useState(() => startsCollapsed())
|
||||
const [switching, setSwitching] = useState(false)
|
||||
const [pulseLevel, setPulseLevel] = useState('ok')
|
||||
const chatUnread = useChatUnread()
|
||||
const counts = useSidebarCounts()
|
||||
|
||||
// Serverpuls-Punkt: nur Admins, beim Laden und alle 5 Minuten; Fehler bleiben still
|
||||
useEffect(() => {
|
||||
@@ -72,7 +78,7 @@ export default function Sidebar() {
|
||||
}
|
||||
|
||||
// Eintraege und Unterpunkte (Kunden -> Chat) aus lib/navLinks.js, Icons ueber key
|
||||
const links = buildNavLinks({ isAdmin, pulseLevel, chatUnread })
|
||||
const links = buildNavLinks({ isAdmin, pulseLevel, counts })
|
||||
|
||||
const isActive = (href) =>
|
||||
location.pathname === href || location.pathname.startsWith(href + '/')
|
||||
@@ -125,7 +131,7 @@ export default function Sidebar() {
|
||||
key={child.href}
|
||||
to={child.href}
|
||||
className={`side-link side-sublink ${isActive(child.href) ? 'active' : ''}`}
|
||||
title={child.count > 0 ? `${child.label} (${child.count} ungelesen)` : child.label}
|
||||
title={child.count > 0 ? `${child.label} (${child.count} ${child.key === 'chat' ? 'ungelesen' : 'offen'})` : child.label}
|
||||
>
|
||||
{ICONS[child.key]}
|
||||
<span className="side-link-label">{child.label}</span>
|
||||
|
||||
Reference in new issue
Block a user