/** * TrusteeDashboardView * * Übersicht/Dashboard für eine Trustee-Instanz. * Zeigt Statistiken über Positionen, Dokumente und Verknüpfungen. */ import React from 'react'; import { useCurrentInstance } from '../../../hooks/useCurrentInstance'; import { useTrusteePositions, useTrusteeDocuments, useTrusteePositionDocuments } from '../../../hooks/useTrustee'; import styles from './TrusteeViews.module.css'; export const TrusteeDashboardView: React.FC = () => { const { instance } = useCurrentInstance(); const { items: positions, loading: posLoading } = useTrusteePositions(); const { items: documents, loading: docsLoading } = useTrusteeDocuments(); const { items: links, loading: linksLoading } = useTrusteePositionDocuments(); const isLoading = posLoading || docsLoading || linksLoading; return (
{/* Positionen Card */}
📊
{isLoading ? '...' : positions.length}
Positionen
{/* Dokumente Card */}
📄
{isLoading ? '...' : documents.length}
Dokumente
{/* Verknüpfungen Card */}
🔗
{isLoading ? '...' : links.length}
Zuordnungen
{/* Rollen Card */}
👤
{instance?.userRoles?.length ? ( instance.userRoles.map((role, idx) => (
{role}
)) ) : '-'}
{(instance?.userRoles?.length || 0) === 1 ? 'Deine Rolle' : 'Deine Rollen'}
{/* Info-Bereich */}

Instanz-Details

Instanz: {instance?.instanceLabel}
Mandant: {instance?.mandateName}
); }; export default TrusteeDashboardView;