fix(sidebar): replace 'agents' with 'store' in sidebar (#10989)

refactor(sidebar): replace 'agents' with 'store' in sidebar icons and labels

Update sidebar icon mapping and translation keys to use 'store' instead of 'agents' for consistency with the application's terminology. The change includes both the label definitions and the icon component mapping.
This commit is contained in:
Phantom 2025-10-27 20:35:12 +08:00 committed by GitHub
parent 250f59234b
commit 9776b4e46c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 13 deletions

View File

@ -165,9 +165,21 @@ export const getThemeModeLabel = (key: string): string => {
return getLabel(themeModeKeyMap, key)
}
// const sidebarIconKeyMap = {
// assistants: t('assistants.title'),
// store: t('assistants.presets.title'),
// paintings: t('paintings.title'),
// translate: t('translate.title'),
// minapp: t('minapp.title'),
// knowledge: t('knowledge.title'),
// files: t('files.title'),
// code_tools: t('code.title'),
// notes: t('notes.title')
// } as const
const sidebarIconKeyMap = {
assistants: 'assistants.title',
agents: 'agents.title',
store: 'assistants.presets.title',
paintings: 'paintings.title',
translate: 'translate.title',
minapp: 'minapp.title',

View File

@ -23,7 +23,7 @@ import {
Palette,
Sparkle
} from 'lucide-react'
import { FC, useCallback, useMemo } from 'react'
import { FC, ReactNode, useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
@ -118,17 +118,18 @@ const SidebarIconsManager: FC<SidebarIconsManagerProps> = ({
// 使用useMemo缓存图标映射
const iconMap = useMemo(
() => ({
assistants: <MessageSquareQuote size={16} />,
agents: <Sparkle size={16} />,
paintings: <Palette size={16} />,
translate: <Languages size={16} />,
minapp: <LayoutGrid size={16} />,
knowledge: <FileSearch size={16} />,
files: <Folder size={16} />,
notes: <NotepadText size={16} />,
code_tools: <Code size={16} />
}),
() =>
({
assistants: <MessageSquareQuote size={16} />,
store: <Sparkle size={16} />,
paintings: <Palette size={16} />,
translate: <Languages size={16} />,
minapp: <LayoutGrid size={16} />,
knowledge: <FileSearch size={16} />,
files: <Folder size={16} />,
notes: <NotepadText size={16} />,
code_tools: <Code size={16} />
}) satisfies Record<SidebarIcon, ReactNode>,
[]
)