feat(confidence-engine): v0.60h migrate report route to use route [id] identity
This commit is contained in:
@@ -4,7 +4,8 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
import { loadInvestigation, saveInvestigation } from "@/lib/storage/investigation-storage";
|
||||
import Link from "next/link";
|
||||
|
||||
export default function ReportPage() {
|
||||
export default function ReportPage({ params }) {
|
||||
const routeId = (typeof params === "object" && params?.id != null) ? String(params.id) : "";
|
||||
const [existing, setExisting] = useState(null);
|
||||
const [hydrated, setHydrated] = useState(false);
|
||||
const [generationLoading, setGenerationLoading] = useState(false);
|
||||
@@ -14,7 +15,7 @@ export default function ReportPage() {
|
||||
const generationAttempted = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
setExisting(loadInvestigation());
|
||||
setExisting(loadInvestigation(routeId));
|
||||
setHydrated(true);
|
||||
}, []);
|
||||
|
||||
@@ -72,7 +73,7 @@ export default function ReportPage() {
|
||||
if (updateLoading) return;
|
||||
setUpdateLoading(true);
|
||||
|
||||
const snap = loadInvestigation();
|
||||
const snap = loadInvestigation(routeId);
|
||||
const situationGraph = snap?.situationGraph;
|
||||
const findings = snap?.findings ?? [];
|
||||
const rev = snap?.investigationRevision ?? 0;
|
||||
@@ -213,7 +214,7 @@ export default function ReportPage() {
|
||||
{/* Back to investigation */}
|
||||
<div className="mt-10">
|
||||
<Link
|
||||
href="/investigations/case-1"
|
||||
href={`/investigations/${routeId}`}
|
||||
className="rounded-lg border border-teal-600 bg-white px-4 py-2 text-sm font-medium text-teal-700 hover:bg-teal-50 transition"
|
||||
>
|
||||
Back to investigation
|
||||
|
||||
Reference in New Issue
Block a user