import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { Menu } from '@headlessui/react' import type { PropsWithChildren } from 'react' import { ActionIcon } from '@src/components/ActionIcon' import { editorShortcutMeta } from '@src/components/ModelingSidebar/ModelingPanes/KclEditorPane' import { useConvertToVariable } from '@src/hooks/useToolbarGuards' import { openExternalBrowserIfDesktop } from '@src/lib/openWindow' import { kclManager } from '@src/lib/singletons' import { reportRejection } from '@src/lib/trap' import { commandBarActor } from '@src/machines/commandBarMachine' import styles from './KclEditorMenu.module.css' export const KclEditorMenu = ({ children }: PropsWithChildren) => { const { enable: convertToVarEnabled, handleClick: handleConvertToVarClick } = useConvertToVariable() return ( {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
{ const target = e.target as HTMLElement if (e.eventPhase === 3 && target.closest('a') === null) { e.stopPropagation() e.preventDefault() } }} > {convertToVarEnabled && ( )} Read the KCL docs zoo.dev View all samples zoo.dev
) }