Harden components: add ErrorBoundary, null-safe rendering
This commit is contained in:
@@ -35,9 +35,9 @@ function CraftingPanel() {
|
||||
{(craftable || []).map((recipe, idx) => (
|
||||
<div key={idx} className="craft-card">
|
||||
<div className="craft-output">
|
||||
<ItemIcon itemName={recipe.output} size={32} />
|
||||
<ItemIcon itemName={recipe.output || ''} size={32} />
|
||||
<div className="craft-info">
|
||||
<span className="craft-name">{formatItemName(recipe.output)}</span>
|
||||
<span className="craft-name">{formatItemName(recipe.output || '')}</span>
|
||||
<span className="craft-count">Produces {recipe.count || 1}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,8 +45,8 @@ function CraftingPanel() {
|
||||
<div className="craft-ingredients">
|
||||
{recipe.slots && Object.entries(recipe.slots).map(([slot, item]) => (
|
||||
<div key={slot} className="craft-ingredient">
|
||||
<ItemIcon itemName={item} size={16} />
|
||||
<span>{formatItemName(item)}</span>
|
||||
<ItemIcon itemName={item || ''} size={16} />
|
||||
<span>{formatItemName(item || '')}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user