import React, { useContext, useState } from 'react'; import { css, useCompile } from '@tachybase/client'; import { MenuOutlined } from '@ant-design/icons'; import { Button, Input, Menu, Popover } from 'antd'; import { CollapsedContext } from '../GraphDrawPage'; import { getPopupContainer, useGCMTranslation } from '../utils'; export const LocateCollectionAction = (props) => { const { handleFiterCollections } = props; const { handleSearchCollection, collectionList } = useContext(CollapsedContext); const [selectedKeys, setSelectKey] = useState([]); const { t } = useGCMTranslation(); const compile = useCompile(); const content = (
{ return { key: v.name, label: compile(v.title), onClick: (e: any) => { if (e.key !== selectedKeys[0]) { setSelectKey([e.key]); handleFiterCollections(e.key); } else { handleFiterCollections(false); setSelectKey([]); } }, }; }), ]} />
); return ( ); };