|
| 1 | +import { Card, CardContent, CardHeader, CardTitle } from './ui/card'; |
| 2 | +import { Badge } from './ui/badge'; |
| 3 | +import { Button } from './ui/button'; |
| 4 | +import { Lightbulb, ArrowRight, TrendingUp, Shield, Zap, Code } from 'lucide-react'; |
| 5 | +import { |
| 6 | + Table, |
| 7 | + TableBody, |
| 8 | + TableCell, |
| 9 | + TableHead, |
| 10 | + TableHeader, |
| 11 | + TableRow, |
| 12 | +} from './ui/table'; |
| 13 | + |
| 14 | +interface Suggestion { |
| 15 | + id: string; |
| 16 | + category: 'performance' | 'security' | 'code_quality' | 'automation'; |
| 17 | + title: string; |
| 18 | + description: string; |
| 19 | + impact: 'high' | 'medium' | 'low'; |
| 20 | + effort: 'high' | 'medium' | 'low'; |
| 21 | + source: string; |
| 22 | + suggestedBy: string; |
| 23 | +} |
| 24 | + |
| 25 | +const mockSuggestions: Suggestion[] = [ |
| 26 | + { |
| 27 | + id: '1', |
| 28 | + category: 'performance', |
| 29 | + title: 'Lazy Loading für Agent Cards', |
| 30 | + description: 'Agent Cards erst laden wenn sie im Viewport sichtbar sind', |
| 31 | + impact: 'high', |
| 32 | + effort: 'low', |
| 33 | + source: 'code-cloud-agents', |
| 34 | + suggestedBy: 'Engineering Lead', |
| 35 | + }, |
| 36 | + { |
| 37 | + id: '2', |
| 38 | + category: 'security', |
| 39 | + title: 'API Rate Limiting implementieren', |
| 40 | + description: 'Schutz vor API Abuse durch Request-Limits pro User/Agent', |
| 41 | + impact: 'high', |
| 42 | + effort: 'medium', |
| 43 | + source: 'mcp-servers', |
| 44 | + suggestedBy: 'Monitoring Agent', |
| 45 | + }, |
| 46 | + { |
| 47 | + id: '3', |
| 48 | + category: 'code_quality', |
| 49 | + title: 'TypeScript Strict Mode aktivieren', |
| 50 | + description: 'Strict Mode für bessere Typsicherheit im gesamten Projekt', |
| 51 | + impact: 'medium', |
| 52 | + effort: 'high', |
| 53 | + source: 'code-cloud-agents', |
| 54 | + suggestedBy: 'Research Agent', |
| 55 | + }, |
| 56 | + { |
| 57 | + id: '4', |
| 58 | + category: 'automation', |
| 59 | + title: 'Auto-Deployment Pipeline', |
| 60 | + description: 'GitHub Actions für automatisches Deployment bei Merge', |
| 61 | + impact: 'high', |
| 62 | + effort: 'medium', |
| 63 | + source: 'infrastructure', |
| 64 | + suggestedBy: 'Deployment Agent', |
| 65 | + }, |
| 66 | + { |
| 67 | + id: '5', |
| 68 | + category: 'performance', |
| 69 | + title: 'Memory Server Caching', |
| 70 | + description: 'Redis Cache vor Pinecone für häufige Queries', |
| 71 | + impact: 'medium', |
| 72 | + effort: 'medium', |
| 73 | + source: 'mcp-servers', |
| 74 | + suggestedBy: 'Memory Server', |
| 75 | + }, |
| 76 | + { |
| 77 | + id: '6', |
| 78 | + category: 'security', |
| 79 | + title: 'Shadow Level Audit Logging', |
| 80 | + description: 'Alle Shadow-Level Zugriffe in separatem Log tracken', |
| 81 | + impact: 'high', |
| 82 | + effort: 'low', |
| 83 | + source: 'memory-server', |
| 84 | + suggestedBy: 'Meta Supervisor', |
| 85 | + }, |
| 86 | + { |
| 87 | + id: '7', |
| 88 | + category: 'automation', |
| 89 | + title: 'Automatische STOP Score Alerts', |
| 90 | + description: 'Slack-Benachrichtigung wenn STOP Score > 50', |
| 91 | + impact: 'medium', |
| 92 | + effort: 'low', |
| 93 | + source: 'code-cloud-agents', |
| 94 | + suggestedBy: 'Monitoring Agent', |
| 95 | + }, |
| 96 | + { |
| 97 | + id: '8', |
| 98 | + category: 'code_quality', |
| 99 | + title: 'Unit Test Coverage > 80%', |
| 100 | + description: 'Test Coverage für alle MCP Server erhöhen', |
| 101 | + impact: 'medium', |
| 102 | + effort: 'high', |
| 103 | + source: 'mcp-servers', |
| 104 | + suggestedBy: 'Engineering Lead', |
| 105 | + }, |
| 106 | +]; |
| 107 | + |
| 108 | +const categoryIcons = { |
| 109 | + performance: <Zap className="w-4 h-4 text-yellow-500" />, |
| 110 | + security: <Shield className="w-4 h-4 text-red-500" />, |
| 111 | + code_quality: <Code className="w-4 h-4 text-blue-500" />, |
| 112 | + automation: <TrendingUp className="w-4 h-4 text-green-500" />, |
| 113 | +}; |
| 114 | + |
| 115 | +const categoryLabels = { |
| 116 | + performance: 'Performance', |
| 117 | + security: 'Security', |
| 118 | + code_quality: 'Code Quality', |
| 119 | + automation: 'Automation', |
| 120 | +}; |
| 121 | + |
| 122 | +const impactColors = { |
| 123 | + high: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400', |
| 124 | + medium: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400', |
| 125 | + low: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400', |
| 126 | +}; |
| 127 | + |
| 128 | +const effortColors = { |
| 129 | + high: 'bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400', |
| 130 | + medium: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400', |
| 131 | + low: 'bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-400', |
| 132 | +}; |
| 133 | + |
| 134 | +export function ImprovementSuggestions() { |
| 135 | + return ( |
| 136 | + <Card> |
| 137 | + <CardHeader> |
| 138 | + <CardTitle className="flex items-center gap-2"> |
| 139 | + <Lightbulb className="w-5 h-5" /> |
| 140 | + Verbesserungsvorschläge |
| 141 | + </CardTitle> |
| 142 | + </CardHeader> |
| 143 | + <CardContent> |
| 144 | + <div className="rounded-md border overflow-hidden"> |
| 145 | + <Table> |
| 146 | + <TableHeader> |
| 147 | + <TableRow> |
| 148 | + <TableHead className="w-[120px]">Kategorie</TableHead> |
| 149 | + <TableHead>Vorschlag</TableHead> |
| 150 | + <TableHead className="w-[100px]">Impact</TableHead> |
| 151 | + <TableHead className="w-[100px]">Aufwand</TableHead> |
| 152 | + <TableHead className="w-[120px]">Repository</TableHead> |
| 153 | + <TableHead className="w-[140px]">Vorgeschlagen von</TableHead> |
| 154 | + <TableHead className="w-[80px]"></TableHead> |
| 155 | + </TableRow> |
| 156 | + </TableHeader> |
| 157 | + <TableBody> |
| 158 | + {mockSuggestions.map((suggestion) => ( |
| 159 | + <TableRow key={suggestion.id} className="hover:bg-muted/50"> |
| 160 | + <TableCell> |
| 161 | + <div className="flex items-center gap-2"> |
| 162 | + {categoryIcons[suggestion.category]} |
| 163 | + <span className="text-xs">{categoryLabels[suggestion.category]}</span> |
| 164 | + </div> |
| 165 | + </TableCell> |
| 166 | + <TableCell> |
| 167 | + <div> |
| 168 | + <p className="font-medium text-sm">{suggestion.title}</p> |
| 169 | + <p className="text-xs text-muted-foreground">{suggestion.description}</p> |
| 170 | + </div> |
| 171 | + </TableCell> |
| 172 | + <TableCell> |
| 173 | + <Badge className={impactColors[suggestion.impact]}> |
| 174 | + {suggestion.impact === 'high' ? 'Hoch' : suggestion.impact === 'medium' ? 'Mittel' : 'Niedrig'} |
| 175 | + </Badge> |
| 176 | + </TableCell> |
| 177 | + <TableCell> |
| 178 | + <Badge className={effortColors[suggestion.effort]}> |
| 179 | + {suggestion.effort === 'high' ? 'Hoch' : suggestion.effort === 'medium' ? 'Mittel' : 'Niedrig'} |
| 180 | + </Badge> |
| 181 | + </TableCell> |
| 182 | + <TableCell> |
| 183 | + <span className="text-xs text-muted-foreground">{suggestion.source}</span> |
| 184 | + </TableCell> |
| 185 | + <TableCell> |
| 186 | + <span className="text-xs">{suggestion.suggestedBy}</span> |
| 187 | + </TableCell> |
| 188 | + <TableCell> |
| 189 | + <Button variant="ghost" size="sm" className="h-8 w-8 p-0"> |
| 190 | + <ArrowRight className="w-4 h-4" /> |
| 191 | + </Button> |
| 192 | + </TableCell> |
| 193 | + </TableRow> |
| 194 | + ))} |
| 195 | + </TableBody> |
| 196 | + </Table> |
| 197 | + </div> |
| 198 | + </CardContent> |
| 199 | + </Card> |
| 200 | + ); |
| 201 | +} |
0 commit comments