diff --git a/web/client/src/components/CraftingPanel.jsx b/web/client/src/components/CraftingPanel.jsx new file mode 100644 index 0000000..2b40a4f --- /dev/null +++ b/web/client/src/components/CraftingPanel.jsx @@ -0,0 +1,71 @@ +import React, { useState } from 'react'; +import { useInventoryStore } from '../store/inventoryStore'; +import { formatItemName } from '../utils/itemUtils'; +import ItemIcon from './ItemIcon'; +import './CraftingPanel.css'; + +function CraftingPanel() { + const craftable = useInventoryStore((state) => state.craftable); + const craftTurtleOk = useInventoryStore((state) => state.craftTurtleOk); + const craftItem = useInventoryStore((state) => state.craftItem); + const [craftingIdx, setCraftingIdx] = useState(null); + + const handleCraft = async (idx) => { + setCraftingIdx(idx); + await craftItem(idx); + setCraftingIdx(null); + }; + + return ( +