import React from 'react'; import { useCallback } from 'react'; import { observer } from 'mobx-react-lite'; import { CloseButton } from 'UI'; function ToolPanel({ toolbar, player }) { const currentKey = player.toolPanel.key; const tool = toolbar.find(p => p.key === currentKey); if (!tool) { return null; } return (