mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
refactor(InputbarTools): 重命名getMenuItems为menuItems以提高可读性
This commit is contained in:
parent
399118174e
commit
6076d5b74c
@ -501,7 +501,7 @@ const InputbarTools = ({
|
||||
return hiddenTools.filter((tool) => tool.condition ?? true).length > 0
|
||||
}, [hiddenTools])
|
||||
|
||||
const getMenuItems = useMemo(() => {
|
||||
const menuItems = useMemo(() => {
|
||||
const baseItems: ItemType[] = [...visibleTools, ...hiddenTools].map((tool) => ({
|
||||
label: tool.label,
|
||||
key: tool.key,
|
||||
@ -533,7 +533,7 @@ const InputbarTools = ({
|
||||
}, [hiddenTools, t, targetTool, toggleToolVisibility, visibleTools])
|
||||
|
||||
return (
|
||||
<Dropdown menu={{ items: getMenuItems }} trigger={['contextMenu']}>
|
||||
<Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>
|
||||
<ToolsContainer
|
||||
onContextMenu={(e) => {
|
||||
const target = e.target as HTMLElement
|
||||
|
||||
Loading…
Reference in New Issue
Block a user