import { Link } from 'react-router-dom' import { Inbox } from 'lucide-react' import { useOrgInbox } from '../context/OrgInboxContext' /** * Desktop-Dashboard: Hinweis auf offene Beitrittsanträge (nur ab 1024px sichtbar via CSS). */ export default function DashboardOrgInboxWidget() { const { canShowInboxNav, inboxJoinRequests, inboxClubCreationRequests, clubCreationRequestCount, inboxCount, } = useOrgInbox() if (!canShowInboxNav) return null const preview = [ ...(inboxClubCreationRequests || []).map((req) => ({ key: `creation-${req.id}`, club: req.proposed_name || 'Neuer Verein', applicant: req.applicant_name || req.applicant_email || 'Antragsteller/in', kind: 'creation', })), ...(inboxJoinRequests || []).map((req) => ({ key: `${req.club_id}-${req.id}`, club: req.club_name || 'Verein', applicant: req.applicant_name || req.applicant_email || 'Bewerber/in', kind: 'join', })), ].slice(0, 5) return (

Posteingang

{inboxCount > 0 ? ( {inboxCount} ) : null}

{inboxCount === 0 ? 'Keine offenen Anträge.' : [ clubCreationRequestCount > 0 ? `${clubCreationRequestCount} Gründungsantrag${clubCreationRequestCount === 1 ? '' : 'e'}` : null, (inboxJoinRequests || []).length > 0 ? `${(inboxJoinRequests || []).length} Beitrittsantrag${(inboxJoinRequests || []).length === 1 ? '' : 'e'}` : null, ] .filter(Boolean) .join(' · ')}

{preview.length > 0 ? ( ) : null}
Zum Posteingang
) }