import React, { useState } from 'react'; import { Link, useParams } from 'react-router-dom'; import { useApi } from '../hooks/useApi'; import { getMemoryProvenance, type LoreProvenance, type SupersessionLink } from '../api/lore'; function formatDate(ts: string): string { if (!ts) return 'β'; const d = new Date(ts); return Number.isNaN(d.getTime()) ? ts : d.toLocaleString(); } function TrustBadge({ signal }: { signal: string }): React.ReactElement { const owned = signal === 'owned'; return ( {owned ? 'π Owned' : 'π€ Anonymous'} ); } function MetaRow({ label, children }: { label: string; children: React.ReactNode }): React.ReactElement { return (
{link.reason || (no reason)}
{formatDate(link.ts)} {targetId && ( <> {` Β· ${arrow} `} {targetId} > )}
Unable to load lineage
{prov.error}
{p.id}
{/* Metadata */}{view === 'chain' ? 'Forward audit trail β what this memory was superseded by.' : 'Source memories this one consolidated.'}
{links.length === 0 ? (No lineage recorded.
) : (