feat(cookie): 2. Sicht Banner-Kategorie + Fehl-Einsortierung
CookieResultView bekommt einen Umschalter [Rechtliche Rolle] ↔ [Banner-Kategorie] (Notwendig/Funktional/Statistik/Marketing). In beiden Sichten zeigt jede Cookie-Zeile '→ sollte: Marketing', wenn die tatsächliche Kategorie laut Library von der deklarierten abweicht (rot bei Tracker als notwendig, § 25 TDDDG). Neue KPI 'Falsch einsortiert'. Backend liefert dazu cookie_categories (name→actual_category) aus big_lib im cookie-check-Output; Seite lädt cookie-check einmal und reicht es an beide Komponenten. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -139,11 +139,14 @@ export function CookieFindingList({ data }: { data: CheckData }) {
|
||||
)
|
||||
}
|
||||
|
||||
export function CookieLibraryPanel({ snapshotId }: { snapshotId: string }) {
|
||||
const [data, setData] = useState<CheckData | null>(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
export function CookieLibraryPanel(
|
||||
{ snapshotId, data: provided }: { snapshotId: string; data?: CheckData },
|
||||
) {
|
||||
const [data, setData] = useState<CheckData | null>(provided ?? null)
|
||||
const [loading, setLoading] = useState(!provided)
|
||||
|
||||
useEffect(() => {
|
||||
if (provided) { setData(provided); setLoading(false); return }
|
||||
let cancelled = false
|
||||
fetch(`/api/sdk/v1/agent/snapshots/${snapshotId}/cookie-check`)
|
||||
.then(r => r.json())
|
||||
@@ -151,7 +154,7 @@ export function CookieLibraryPanel({ snapshotId }: { snapshotId: string }) {
|
||||
.catch(() => { if (!cancelled) setData({ findings: [] }) })
|
||||
.finally(() => { if (!cancelled) setLoading(false) })
|
||||
return () => { cancelled = true }
|
||||
}, [snapshotId])
|
||||
}, [snapshotId, provided])
|
||||
|
||||
if (loading) return <div className="text-xs text-gray-400">Library-Abgleich läuft…</div>
|
||||
return <CookieFindingList data={data || {}} />
|
||||
|
||||
Reference in New Issue
Block a user