"use client"; import React from "react"; import { loadInvestigation, clearInvestigation } from "@/lib/storage/investigation-storage"; import Link from "next/link"; const INVESTIGATION_ID = "case-1"; function Portfolio() { const [existing, setExisting] = React.useState(null); const [showRestartConfirm, setShowRestartConfirm] = React.useState(false); React.useEffect(() => { setExisting(loadInvestigation()); }, []); const hasReport = Boolean( existing?.investigationReport && existing.investigationReport.understanding ); const reportIsCurrent = hasReport && existing.investigationReport.generatedFromRevision === (existing.investigationRevision ?? 0); return (

Confidence Engine

Investigator's notebook — index of persisted investigations.

{/* Existing investigation */} {existing && (

Investigations

{existing.scenario || "Untitled investigation"}

{hasReport ? (
View report {reportIsCurrent ? ( Current ) : ( Update available )}
) : null} Continue investigation {showRestartConfirm && (
setShowRestartConfirm(false)} >
e.stopPropagation()} >

Restart this investigation?

Your current investigation, findings, clarified questions, and report will be lost. Are you sure you want to continue?

)}
)} {/* No existing investigation */} {!existing && (

Investigations

No investigations yet.

)} + Create new investigation
); } export default Portfolio;