'use client' import { ChevronRight, Clock, Lightbulb, ClipboardCheck, BookOpen, Calendar, Users, MessageSquare, FileText } from 'lucide-react' import { Suggestion, SuggestionPriority } from '@/lib/companion/types' import { PRIORITY_COLORS } from '@/lib/companion/constants' interface SuggestionListProps { suggestions: Suggestion[] onSuggestionClick?: (suggestion: Suggestion) => void loading?: boolean maxItems?: number } const iconMap: Record> = { ClipboardCheck, BookOpen, Calendar, Users, Clock, MessageSquare, FileText, Lightbulb, } function getIcon(iconName: string) { const Icon = iconMap[iconName] || Lightbulb return Icon } interface SuggestionCardProps { suggestion: Suggestion onClick?: () => void } function SuggestionCard({ suggestion, onClick }: SuggestionCardProps) { const priorityStyles = PRIORITY_COLORS[suggestion.priority] const Icon = getIcon(suggestion.icon) return ( ) } export function SuggestionList({ suggestions, onSuggestionClick, loading, maxItems = 5, }: SuggestionListProps) { // Sort by priority: urgent > high > medium > low const priorityOrder: Record = { urgent: 0, high: 1, medium: 2, low: 3, } const sortedSuggestions = [...suggestions] .sort((a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]) .slice(0, maxItems) if (loading) { return (

Vorschlaege

{[1, 2, 3].map((i) => (
))}
) } if (suggestions.length === 0) { return (

Vorschlaege

Alles erledigt!

Keine offenen Aufgaben

) } return (

Vorschlaege

{suggestions.length} Aufgabe{suggestions.length !== 1 ? 'n' : ''}
{sortedSuggestions.map((suggestion) => ( onSuggestionClick?.(suggestion)} /> ))}
{suggestions.length > maxItems && ( )}
) }