"use client"; // 回响星核 / Echo Nexus — 记忆图谱(碎片叙事) import { useState } from "react"; import { useGameStore, FRAGMENTS } from "@/store/gameStore"; import { nextFragmentThreshold } from "@/store/gameStore"; import { Card } from "@/components/ui/card"; import { ScrollArea } from "@/components/ui/scroll-area"; import { BookOpen, Lock, Sparkles } from "lucide-react"; import type { Fragment } from "@/lib/game/types"; const ERA_NAMES = ["", "寂灭前夜", "谐振纪", "飞升潮", "回响纪", "接触纪"]; export function Codex() { const fragments = useGameStore((s) => s.fragments); const totalDecoded = useGameStore((s) => s.totalDecoded); const nextThreshold = nextFragmentThreshold(totalDecoded); const [selected, setSelected] = useState(null); // v0.1 只展示第一纪元 const era1 = FRAGMENTS.filter((f) => f.era === 1); const unlockedCount = era1.filter((f) => fragments[f.id]).length; return (

记忆图谱

{unlockedCount}/{era1.length} · 第一纪元
{nextThreshold && (
再解码 {nextThreshold - totalDecoded} 颗 → 下一个碎片
)}
{era1.map((f, i) => { const unlocked = !!fragments[f.id]; return ( ); })}
{/* 详情弹层 */} {selected && (
setSelected(null)} > e.stopPropagation()} style={{ boxShadow: "0 0 40px rgba(232,121,249,0.25)" }} >
第 {selected.era} 纪元 · {ERA_NAMES[selected.era] || ""}

{selected.title}

「{selected.echo}」

)}
); }