diff options
Diffstat (limited to 'src/AddNodeMenu.tsx')
| -rw-r--r-- | src/AddNodeMenu.tsx | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/AddNodeMenu.tsx b/src/AddNodeMenu.tsx deleted file mode 100644 index 197f56d..0000000 --- a/src/AddNodeMenu.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { useId } from 'preact/hooks'; -import { NodeInfo } from './node.tsx'; - -export interface AddNodeMenuProps { - nodes: Record<string, NodeInfo>; - onClick?: (NodeInfo) => void; -} - -export const AddNodeMenu = ({ nodes, onClick = _ => {} }: AddNodeMenuProps) => { - const id = useId(); - return ( - <> - <menu id={id} popover> - {Object.entries(nodes).map(([name, node]) => ( - <li><button onClick={() => onClick(node)}>{name}</button></li> - ))} - </menu> - <button popoverTarget={id}>Add</button> - </> - ); -};
\ No newline at end of file |
