fix: Erstbewertung aus risk_assessment + Pagination + Projektname

- Erstbewertung S/E/P liest jetzt aus risk_assessment statt hazard
- Hazards: Pagination 50 pro Seite mit < > Navigation
- Massnahmen: Lazy-Load 50 pro Accordion mit "Mehr laden"
- Sidebar: Projektname (z.B. "Kniehebelpresse HP-500") prominent
- Uebersicht: Nur 2 API-Calls (keine schweren Listen)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-07 17:51:59 +02:00
parent 313ee5073b
commit 58a3fb285f
3 changed files with 51 additions and 12 deletions
+15 -3
View File
@@ -100,6 +100,15 @@ export default function IACELayout({ children }: { children: React.ReactNode })
const pathname = usePathname()
const params = useParams()
const projectId = params?.projectId as string | undefined
const [projectName, setProjectName] = React.useState('')
React.useEffect(() => {
if (!projectId) return
fetch(`/api/sdk/v1/iace/projects/${projectId}`)
.then(r => r.ok ? r.json() : null)
.then(d => { if (d?.machine_name) setProjectName(d.machine_name) })
.catch(() => {})
}, [projectId])
const basePath = projectId ? `/sdk/iace/${projectId}` : ''
@@ -127,9 +136,12 @@ export default function IACELayout({ children }: { children: React.ReactNode })
</svg>
Alle Projekte
</Link>
<h2 className="text-sm font-semibold text-gray-900 dark:text-white mt-2">
CE-Compliance
</h2>
{projectName && (
<p className="text-xs font-bold text-purple-700 dark:text-purple-400 mt-2 truncate" title={projectName}>
{projectName}
</p>
)}
<p className="text-[10px] text-gray-400 mt-0.5">CE-Compliance</p>
<Link
href="/sdk/iace/lines"
className="mt-2 flex items-center gap-1.5 text-xs text-gray-500 hover:text-purple-600 dark:text-gray-400 dark:hover:text-purple-400 transition-colors"