import type { TOMRecommendation } from '../_types'
import { PRIORITY_COLORS, PRIORITY_LABELS, TOM_CATEGORY_ICONS } from '../_constants'
export function TOMTab({ recommendations }: { recommendations: TOMRecommendation[] }) {
if (recommendations.length === 0) {
return (
Keine TOM-Empfehlungen verfuegbar
Fuer diese Branche wurden noch keine technisch-organisatorischen Massnahmen definiert.
)
}
const grouped: Record = {}
recommendations.forEach((tom) => {
if (!grouped[tom.category]) {
grouped[tom.category] = []
}
grouped[tom.category].push(tom)
})
return (
{Object.entries(grouped).map(([category, items]) => {
const icon = TOM_CATEGORY_ICONS[category] || '\uD83D\uDD27'
return (
{icon}
{category}
({items.length})
{items.map((tom, idx) => {
const prio = PRIORITY_COLORS[tom.priority] || PRIORITY_COLORS.medium
const prioLabel = PRIORITY_LABELS[tom.priority] || tom.priority
return (
{tom.name}
{tom.description}
{prioLabel}
)
})}
)
})}
)
}