refactor: cleanup codebase — remove hydration guards, extract constants, fix bugs
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m20s

This commit is contained in:
2026-05-26 11:20:36 +02:00
parent 5c64bb00fa
commit b402b8f56e
23 changed files with 579 additions and 979 deletions
+1 -15
View File
@@ -1,6 +1,6 @@
'use client';
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import React, { useState, useCallback, useMemo } from 'react';
import { useShallow } from 'zustand/react/shallow';
import { useCombatStore } from '@/lib/game/stores/combatStore';
import { useAttunementStore } from '@/lib/game/stores/attunementStore';
@@ -197,7 +197,6 @@ GolemCard.displayName = 'GolemCard';
// ─── Main Tab ────────────────────────────────────────────────────────────────
export const GolemancyTab: React.FC = () => {
const [mounted, setMounted] = useState(false);
const [activeTier, setActiveTier] = useState<string>('base');
const { golemancy, toggleGolem } = useCombatStore(useShallow(s => ({
@@ -210,11 +209,6 @@ export const GolemancyTab: React.FC = () => {
elements: s.elements,
})));
useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
setMounted(true);
}, []);
// Build attunement lookup for isGolemUnlocked
const attunementLookup = useMemo(() => {
const lookup: Record<string, { active: boolean; level: number }> = {};
@@ -254,14 +248,6 @@ export const GolemancyTab: React.FC = () => {
const golemSlots = getGolemSlots(fabricatorLevel);
const enabledCount = golemancy.enabledGolems.length;
if (!mounted) {
return (
<div className="flex items-center justify-center p-8 text-gray-500">
Loading golemancy
</div>
);
}
const activeTierGolems = golemsByTier[activeTier] ?? [];
return (