feat(cra): live-wire CRA tab to POST /api/v1/cra/assess (proxy + useCRA)

CRA tab now computes the assessment live: useCRA POSTs the scenario findings
through a new /api/v1/cra/* proxy to the backend mapper and merges the live
mapping (CRA requirement, risk, measures, NIST/OWASP crosswalk) with the
frontend scenario constants (full measure texts + cyber->safety cross-links,
until those move server-side in step 2). Falls back to the static scenario if
the backend is unreachable.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-06-14 07:30:00 +02:00
parent 34a678caef
commit ad83b8dc67
4 changed files with 164 additions and 7 deletions
@@ -1,9 +1,21 @@
'use client'
import { useCRADemo } from './_hooks/useCRADemo'
import { useCRA } from './_hooks/useCRA'
import { CRACyberView } from './_components/CRACyberView'
export default function CRAPage() {
const { data } = useCRADemo()
return <CRACyberView data={data} />
const { data, live } = useCRA()
if (!data) {
return <p className="text-sm text-gray-500">CRA-Risikobeurteilung wird geladen </p>
}
return (
<div>
{!live && (
<p className="mb-3 text-[11px] text-amber-600 dark:text-amber-400">
Backend nicht erreichbar statisches Szenario angezeigt.
</p>
)}
<CRACyberView data={data} />
</div>
)
}