fix: split SpireTab.tsx to 395 lines, remove require() imports, import from data modules; complete store migration
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 30m15s

This commit is contained in:
Refactoring Agent
2026-05-04 13:36:10 +02:00
parent 0eabd604b0
commit 837d963b63
41 changed files with 727 additions and 3935 deletions
+7 -7
View File
@@ -122,7 +122,7 @@ export function EquipmentTab() {
// Use modular store directly - MUST be called before any conditional returns
const equippedInstances = useCombatStore((s) => s.equippedInstances);
const equipmentInstances = useCombatStore((s) => s.equipmentInstances);
// Get unequipped items - hooks must be called before conditional returns
const equippedIds = useMemo(() =>
new Set(Object.values(equippedInstances || {}).filter(Boolean)),
@@ -230,8 +230,8 @@ export function EquipmentTab() {
// Get unified effects for equipment stats - move hook before conditional
const equipmentInstancesForEffects = useCombatStore((s) => s.equipmentInstances);
const equippedInstancesForEffects = useCombatStore((s) => s.equippedInstances);
const unifiedEffects = equipmentInstancesForEffects && equippedInstancesForEffects
const unifiedEffects = equipmentInstancesForEffects && equippedInstancesForEffects
? getUnifiedEffects({ equipmentInstances, equippedInstances })
: null;
@@ -329,10 +329,10 @@ export function EquipmentTab() {
const enchantPower = effects.enchantmentPowerMultiplier || 1;
return (
<>
<StatRow
<StatRow
label="Enchantment Power:"
value={`${enchantPower.toFixed(2)}×`}
highlight={enchantPower > 1 ? "success" : "default"}
highlight={enchantPower > 1 ? 'success' : 'default'}
/>
<p className="text-xs text-[var(--text-muted)] mt-2">
Increases the power of all enchantments by {(enchantPower - 1) * 100}%. Multiplier applied to all enchantment effects.
@@ -353,11 +353,11 @@ export function EquipmentTab() {
return <span className="text-[var(--text-muted)] text-sm">No active effects</span>;
}
const effectEntries = Object.entries(effects.equipmentEffects).filter(([, v]) => v > 0);
if (effectEntries.length === 0) {
return <span className="text-[var(--text-muted)] text-sm">No active effects</span>;
}
return effectEntries.map(([stat, value]) => (
<Badge key={stat} variant="outline" className="text-xs border-[var(--border-default)] text-[var(--text-secondary)]">
{stat}: +{fmt(value)}