import { useState } from "react"; import styles from './KeymapPanel.module.css'; // Import the CSS module const keyMappings = [ { key: 'W', info: 'Move Up' }, { key: 'A', info: 'Move Left' }, { key: 'S', info: 'Move Down' }, { key: 'D', info: 'Move Right' }, { key: 'Space', info: 'Jump / Shoot' }, { key: 'E', info: 'Interact' }, { key: 'Q', info: 'Switch Weapon' } ]; const KeyboardPanel = () => { const [hoveredKey, setHoveredKey] = useState(null); return (
{keyMappings.map((keyItem, index) => ( ))} {hoveredKey && (
{hoveredKey}
)}
); }; export default KeyboardPanel;