'use client'; import Link from 'next/link'; import { FileText, Calendar, ListChecks, AlertTriangle, } from 'lucide-react'; import { Badge } from '@kit/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@kit/ui/card'; import { MEETING_TYPE_LABELS } from '../lib/meetings-constants'; interface DashboardStats { totalProtocols: number; thisYearProtocols: number; openTasks: number; overdueTasks: number; } interface RecentProtocol { id: string; title: string; meeting_date: string; meeting_type: string; is_published: boolean; } interface OverdueTask { id: string; title: string; responsible_person: string | null; due_date: string | null; status: string; meeting_protocols: { id: string; title: string; }; } interface MeetingsDashboardProps { stats: DashboardStats; recentProtocols: RecentProtocol[]; overdueTasks: OverdueTask[]; account: string; } export function MeetingsDashboard({ stats, recentProtocols, overdueTasks, account, }: MeetingsDashboardProps) { return (
{/* Header */}

Sitzungsprotokolle – Übersicht

Protokolle, Tagesordnungspunkte und Aufgaben verwalten

{/* Stats Grid */}

Protokolle gesamt

{stats.totalProtocols}

Protokolle dieses Jahr

{stats.thisYearProtocols}

Offene Aufgaben

{stats.openTasks}

Überfällige Aufgaben

{stats.overdueTasks}

{/* Recent + Overdue Sections */}
Letzte Protokolle {recentProtocols.length === 0 ? (

Noch keine Protokolle vorhanden.

) : (
{recentProtocols.map((protocol) => (

{protocol.title}

{new Date(protocol.meeting_date).toLocaleDateString('de-DE')} {' · '} {MEETING_TYPE_LABELS[protocol.meeting_type] ?? protocol.meeting_type}

{protocol.is_published && ( Veröffentlicht )} ))}
)}
Überfällige Aufgaben {overdueTasks.length === 0 ? (

Keine überfälligen Aufgaben.

) : (
{overdueTasks.map((task) => (

{task.title}

{task.responsible_person && ( Zuständig: {task.responsible_person} )} {task.due_date && ( Fällig: {new Date(task.due_date).toLocaleDateString('de-DE')} )}

Protokoll: {task.meeting_protocols.title}

))}
)}
); }