mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 21:35:52 +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
|
return hiddenTools.filter((tool) => tool.condition ?? true).length > 0
|
||||||
}, [hiddenTools])
|
}, [hiddenTools])
|
||||||
|
|
||||||
const getMenuItems = useMemo(() => {
|
const menuItems = useMemo(() => {
|
||||||
const baseItems: ItemType[] = [...visibleTools, ...hiddenTools].map((tool) => ({
|
const baseItems: ItemType[] = [...visibleTools, ...hiddenTools].map((tool) => ({
|
||||||
label: tool.label,
|
label: tool.label,
|
||||||
key: tool.key,
|
key: tool.key,
|
||||||
@ -533,7 +533,7 @@ const InputbarTools = ({
|
|||||||
}, [hiddenTools, t, targetTool, toggleToolVisibility, visibleTools])
|
}, [hiddenTools, t, targetTool, toggleToolVisibility, visibleTools])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown menu={{ items: getMenuItems }} trigger={['contextMenu']}>
|
<Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>
|
||||||
<ToolsContainer
|
<ToolsContainer
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
const target = e.target as HTMLElement
|
const target = e.target as HTMLElement
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user