mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
18 lines • 802 B
JavaScript
import { jsx as _jsx } from "preact/jsx-runtime";
import { useState } from "preact/hooks";
const MenuItem = ({ disabled, onClick, setData, children }) => {
const [hover, setHover] = useState(false);
return (_jsx("div", { style: {
padding: 6,
whiteSpace: "nowrap",
background: !disabled && hover ? "rgba(255, 255, 255, 0.1)" : undefined,
opacity: disabled ? 0.5 : 1
}, onClick: disabled
? undefined
: () => {
setData?.(undefined);
onClick?.();
}, onMouseEnter: disabled ? undefined : () => setHover(true), onMouseLeave: disabled ? undefined : () => setHover(false), children: children }));
};
export default MenuItem;
//# sourceMappingURL=MenuItem.js.map