import type { ReactNode } from 'react'; import { CalendarClock, ChevronRight, MoreHorizontal, Plus, Users } from 'lucide-react'; import { Avatar, AvatarStack, type Person } from '../Avatar/Avatar'; import { RoleBadge } from '../Badge/Badge'; import { Button } from '../Button/Button'; import { Card } from '../Card/Card'; import { Menu } from '../Menu/Menu'; import { ProgressBar } from '../Progress/Progress'; export interface GroupData { id: string; name: string; color: string; members: Person[]; done: number; total: number; description?: string; role?: 'admin' | 'member'; /** Next deadline, e.g. "Nächste: Fr, 27. Nov". */ next?: string; } const pct = (g: Pick) => (g.total ? Math.round((g.done / g.total) * 100) : 0); export interface GroupRowProps { group: GroupData; href?: string; } /** Compact group entry with members and progress, used on the dashboard. */ export function GroupRow({ group: g, href = '#' }: GroupRowProps) { const p = pct(g); return (
  • {g.name}
    {p}% · {g.done}/{g.total}
  • ); } export interface GroupCardProps { group: GroupData; href?: string; /** Items of the "…" menu at the top right (`MenuItem`, `MenuLink`, `MenuSeparator`). */ menu?: ReactNode; } /** Group overview card on the Gruppen page. */ export function GroupCard({ group: g, href = '#', menu }: GroupCardProps) { const p = pct(g); const headingId = `gc-${g.id}`; return (

    {g.name}

    {menu && ( } > {menu} )}
    {g.description !== undefined && (

    {g.description}

    )}
    Fortschritt {p}% · {g.done}/{g.total} Aufgaben
    {g.members.length} Mitglieder {g.next && ( )}
    ); } export interface NewGroupTileProps { onClick?: () => void; title?: string; description?: string; } /** Dashed tile that starts creating a group. */ export function NewGroupTile({ onClick, title = 'Neue Gruppe erstellen', description = 'Lade dein Team ein und behaltet Aufgaben und Deadlines gemeinsam im Blick.', }: NewGroupTileProps) { return ( ); } export interface InviteBannerProps { from: Person; groupName: string; onAccept?: () => void; onDecline?: () => void; acceptState?: 'idle' | 'loading' | 'success'; declineState?: 'idle' | 'loading' | 'success'; } /** Pending group invitation, shown above the group grid. */ export function InviteBanner({ from, groupName, onAccept, onDecline, acceptState, declineState }: InviteBannerProps) { const busy = acceptState === 'loading' || declineState === 'loading'; return ( ); }