lobehub/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx
Innei 04cfc0e9e0
♻️ refactor: migrate to new DropdownMenuV2 and showContextMenu API (#11079)
* ♻️ refactor: migrate to new DropdownMenuV2 and showContextMenu API

- Replace Dropdown with DropdownMenuV2 for action menus
- Use showContextMenu for context menu handling instead of Dropdown wrapper
- Update @lobehub/ui to preview version with new context menu API
- Add styles for popup-open state in NavItem component

* ♻️ refactor: migrate to new DropdownMenuV2 and showContextMenu API

* chore: Update @lobehub/ui dependency to version ^4.6.3.

Signed-off-by: Innei <tukon479@gmail.com>

* ♻️ refactor: migrate to new DropdownMenuV2 and showContextMenu API

- Remove deprecated ContextMenu component
- Migrate all context menu usages to DropdownMenuV2 and showContextMenu API
- Update multiple Action components across Conversation features
- Update ResourceManager toolbar components
- Clean up related styles

🤖 Generated with [Claude Code](https://claude.com/claude-code)

* feat: Update `@lobehub/ui` dependency, simplify `ActionIconGroup` menu prop, and ensure action group visibility when popups are open.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: Add null check for context menu items, include debug log, and update `@lobehub/ui` dependency.

Signed-off-by: Innei <tukon479@gmail.com>

* ♻️ refactor: migrate TopicSelector to new DropdownMenuV2 API

Migrate from antd/Dropdown to @lobehub/ui DropdownMenu component
with checkbox items pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-02 01:14:30 +08:00

20 lines
576 B
TypeScript

import { ActionIcon, type DropdownItem, DropdownMenu } from '@lobehub/ui';
import { MoreHorizontalIcon } from 'lucide-react';
import { memo } from 'react';
interface ActionsProps {
dropdownMenu: DropdownItem[] | (() => DropdownItem[]);
}
const Actions = memo<ActionsProps>(({ dropdownMenu }) => {
if (!dropdownMenu || (typeof dropdownMenu !== 'function' && dropdownMenu.length === 0))
return null;
return (
<DropdownMenu items={dropdownMenu}>
<ActionIcon icon={MoreHorizontalIcon} size={'small'} />
</DropdownMenu>
);
});
export default Actions;