'use client';
import { useGameStore, fmt, fmtDec, computePactMultiplier } from '@/lib/game/store';
import { ELEMENTS, GUARDIANS, PRESTIGE_DEF } from '@/lib/game/constants';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { RotateCcw } from 'lucide-react';
export function GrimoireTab() {
const store = useGameStore();
return (
{/* Current Status */}
Loop Status
{store.loopCount}
Loops Completed
{fmt(store.insight)}
Current Insight
{fmt(store.totalInsight)}
Total Insight
{store.memorySlots}
Memory Slots
{/* Signed Pacts */}
Signed Pacts ({store.signedPacts.length}/{1 + (store.prestigeUpgrades.pactCapacity || 0)})
{store.signedPacts.length > 1 && (
Combined: ×{fmtDec(computePactMultiplier(store), 2)} damage
)}
{store.signedPacts.length === 0 ? (
No pacts signed yet. Defeat guardians to earn pacts.
) : (
{store.signedPacts.map((floor) => {
const guardian = GUARDIANS[floor];
if (!guardian) return null;
return (
{guardian.name}
{guardian.theme} • Floor {floor}
{guardian.damageMultiplier}x dmg / {guardian.insightMultiplier}x insight
{/* Unique Boon */}
{guardian.uniqueBoon && (
✨ {guardian.uniqueBoon.name}
{guardian.uniqueBoon.desc}
)}
{/* Perks & Costs */}
{guardian.perks.length > 0 && (
Perks
{guardian.perks.map(perk => (
• {perk.desc}
))}
)}
{guardian.costs.length > 0 && (
Costs
{guardian.costs.map(cost => (
• {cost.desc}
))}
)}
{/* Unlocked Mana */}
{guardian.unlocksMana.length > 0 && (
{guardian.unlocksMana.map(elemId => {
const elem = ELEMENTS[elemId];
return (
{elem?.sym}
);
})}
)}
);
})}
)}
{/* Prestige Upgrades */}
Insight Upgrades (Permanent)
{Object.entries(PRESTIGE_DEF).map(([id, def]) => {
const level = store.prestigeUpgrades[id] || 0;
const maxed = level >= def.max;
const canBuy = !maxed && store.insight >= def.cost;
return (
{def.name}
{level}/{def.max}
{def.desc}
);
})}
{/* Reset Game Button */}
Reset All Progress
Clear all data and start fresh
);
}