import React from "react"; import "./CraftModal.css"; import { getServerUrl } from "../../../../config/api"; const CraftModal = ({ recipe, onClose, onStartCraft, activeCraft, getOwnedAmount, }) => { if (!recipe) return null; const CONNECT_URL = getServerUrl(); const ASSET_BASE_URL = `${CONNECT_URL}/static/`; const getFullTextureUrl = (path) => { if (!path) return "/assets/no-image.png"; return path.startsWith("http") ? path : `${ASSET_BASE_URL}${path}`; }; const isBusy = !!activeCraft; const outputQty = Object.values(recipe.output || {})[0] || 1; const canAfford = recipe.ingredients?.every( (ing) => getOwnedAmount(ing.itemId) >= ing.quantity, ); return (
{recipe.description || "Advanced composite material for high-tier construction."}