Übersetzung Teil 1

This commit is contained in:
Ashikagi
2026-03-23 23:02:51 +01:00
parent cd77f88d96
commit 46d468575a
21 changed files with 1605 additions and 333 deletions

View File

@@ -1,19 +1,22 @@
import React from 'react';
import { useTranslation } from '../../i18n/LanguageContext';
const scoreToPercent = (score) => Math.round(Math.max(0, Math.min(1.5, score)) * 100);
export default function WeaknessPriorityList({ weaknesses = [] }) {
const t = useTranslation();
if (!weaknesses.length) {
return (
<div className="rounded-2xl border border-dashed border-gray-300 dark:border-gray-700 bg-white/70 dark:bg-gray-900/70 p-4 text-sm text-gray-600 dark:text-gray-300">
Keine Schwächen-Daten verfügbar.
{t('weakness.no_data')}
</div>
);
}
return (
<div className="rounded-2xl border border-rose-200 dark:border-rose-900 bg-white dark:bg-gray-900 p-5 shadow-sm">
<h3 className="text-lg font-semibold text-rose-700 dark:text-rose-300 mb-4">Top-3 Schwächen</h3>
<h3 className="text-lg font-semibold text-rose-700 dark:text-rose-300 mb-4">{t('weakness.title')}</h3>
<div className="space-y-3">
{weaknesses.map((item, index) => (
@@ -30,9 +33,9 @@ export default function WeaknessPriorityList({ weaknesses = [] }) {
</span>
</div>
<div className="mt-2 grid grid-cols-3 gap-2 text-xs text-gray-600 dark:text-gray-300">
<p>Gap: {item.gapScore.toFixed(2)}</p>
<p>Konstanz: {item.consistencyScore.toFixed(2)}</p>
<p>Trend: {item.trendDelta.toFixed(2)}</p>
<p>{t('weakness.gap', { score: item.gapScore.toFixed(2) })}</p>
<p>{t('weakness.consistency', { score: item.consistencyScore.toFixed(2) })}</p>
<p>{t('weakness.trend', { score: item.trendDelta.toFixed(2) })}</p>
</div>
</div>
))}