'use client' import React from 'react' import { Risk } from '@/lib/sdk' export function RiskMatrix({ risks, onCellClick }: { risks: Risk[]; onCellClick: (l: number, i: number) => void }) { const matrix: Record = {} risks.forEach(risk => { const key = `${risk.likelihood}-${risk.impact}` if (!matrix[key]) matrix[key] = [] matrix[key].push(risk) }) const getCellColor = (likelihood: number, impact: number): string => { const score = likelihood * impact if (score >= 20) return 'bg-red-500' if (score >= 15) return 'bg-red-400' if (score >= 12) return 'bg-orange-400' if (score >= 8) return 'bg-yellow-400' if (score >= 4) return 'bg-yellow-300' return 'bg-green-400' } return (

5x5 Risikomatrix

Wahrscheinlichkeit
{[5, 4, 3, 2, 1].map(likelihood => ( {[1, 2, 3, 4, 5].map(impact => { const key = `${likelihood}-${impact}` const cellRisks = matrix[key] || [] return ( ) })} ))}
Auswirkung
Niedrig
Mittel
Hoch
Kritisch
) }