e.stopPropagation()}
onClick={(e) => e.stopPropagation()}
style={{
position: 'absolute',
top: 12,
left: '50%',
transform: 'translateX(-50%)',
display: 'flex',
alignItems: 'center',
gap: 6,
background: '#252526',
border: '1px solid #3c3c3c',
borderRadius: 8,
padding: '6px 8px',
boxShadow: '0 4px 16px rgba(0,0,0,0.5)',
zIndex: 50,
fontSize: 13,
color: '#e0e0e0',
pointerEvents: 'auto',
touchAction: 'none',
}}
>
{label}
{kind === 'wire' && onColorChange && (
{showPalette && (
{Object.values(WIRE_KEY_COLORS).map((color) => (
{
onColorChange(color);
setShowPalette(false);
}}
/>
))}
)}
)}
{canRotate && onRotate && (
)}
);
};
const ColorButton: React.FC<{
color: string;
isSelected: boolean;
onClick: () => void;
}> = ({ color, isSelected, onClick }) => {
const ref = useRef