"use client"; // 回响星核 / Echo Nexus — 飞升(Prestige)对话框 import { useGameStore } from "@/store/gameStore"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { RotateCcw, Sparkles, Star, BookOpen } from "lucide-react"; import { PRESTIGE } from "@/lib/game/config"; import { computeNewBlueprints, computePrestigeBonus } from "@/lib/game/engine"; import { constellationProgress } from "@/lib/game/constellation"; import { useState } from "react"; import { useToast } from "@/hooks/use-toast"; import { sfx } from "@/hooks/useAudio"; export function PrestigeDialog({ open, onOpenChange, }: { open: boolean; onOpenChange: (v: boolean) => void; }) { const state = useGameStore(); const doPrestige = useGameStore((s) => s.doPrestige); const { toast } = useToast(); const [confirming, setConfirming] = useState(false); const [canReconfirm, setCanReconfirm] = useState(false); const newBp = computeNewBlueprints(state); const bonus = computePrestigeBonus(state); const totalBpAfter = Math.min(PRESTIGE.maxBlueprints, state.blueprints.length + newBp); const cProgress = constellationProgress(state.constellation ?? []); return ( ); } function BonusCard({ label, value, color, }: { label: string; value: string; color: string; }) { return (