import React from 'react' import { useScale } from '../../context/ScaleContext' import { useInventoryContext } from '../../context/InventoryContext' interface AnvilCostProps { properties: Record backgroundWidth: number } export function AnvilCost({ properties, backgroundWidth }: AnvilCostProps) { const { scale } = useScale() const { windowState } = useInventoryContext() const cost = properties.repairCost ?? 0 const hasResult = windowState?.slots.some((s) => s.index === 2 && s.item !== null) ?? false if (cost <= 0) return null if (!hasResult) return null const tooExpensive = cost >= 40 const label = tooExpensive ? 'Too Expensive!' : `Enchantment Cost: ${cost}` const color = tooExpensive ? '#FF6060' : '#80FF20' return (
{label}
) }