chore: upd app icon

This commit is contained in:
AkaraChen 2024-12-26 12:32:02 +08:00
parent e07d7ee4fc
commit cd08f98bff

View File

@ -15,6 +15,7 @@ import { useStrategyProviders } from '@/service/use-strategy'
import type { StrategyPluginDetail } from '@/app/components/plugins/types' import type { StrategyPluginDetail } from '@/app/components/plugins/types'
import type { ToolWithProvider } from '../../../types' import type { ToolWithProvider } from '../../../types'
import { CollectionType } from '@/app/components/tools/types' import { CollectionType } from '@/app/components/tools/types'
import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-icon'
const ExternalNotInstallWarn = () => { const ExternalNotInstallWarn = () => {
const { t } = useTranslation() const { t } = useTranslation()
@ -82,15 +83,19 @@ export const AgentStrategySelector = (props: AgentStrategySelectorProps) => {
}, [query, list]) }, [query, list])
// TODO: should be replaced by real data // TODO: should be replaced by real data
const isExternalInstalled = true const isExternalInstalled = true
const { getIconUrl } = useGetIcon()
// TODO: 验证这玩意写对了没
const iconFilename = list?.find(
coll => coll.tools?.find(tool => tool.name === value?.agent_strategy_name),
)?.icon
const icon = iconFilename ? getIconUrl(iconFilename as string) : undefined
const { t } = useTranslation() const { t } = useTranslation()
return <PortalToFollowElem open={open} onOpenChange={setOpen} placement='bottom'> return <PortalToFollowElem open={open} onOpenChange={setOpen} placement='bottom'>
<PortalToFollowElemTrigger className='w-full'> <PortalToFollowElemTrigger className='w-full'>
<div className='py-2 pl-3 pr-2 flex items-center rounded-lg bg-components-input-bg-normal w-full hover:bg-state-base-hover-alt select-none' onClick={() => setOpen(o => !o)}> <div className='py-2 pl-3 pr-2 flex items-center rounded-lg bg-components-input-bg-normal w-full hover:bg-state-base-hover-alt select-none' onClick={() => setOpen(o => !o)}>
{/* eslint-disable-next-line @next/next/no-img-element */} {/* eslint-disable-next-line @next/next/no-img-element */}
{list && value && <img {icon && <img
src={list.find( src={icon}
coll => coll.tools?.find(tool => tool.name === value.agent_strategy_name),
)?.icon as string}
width={20} width={20}
height={20} height={20}
className='rounded-md border-[0.5px] border-components-panel-border-subtle bg-background-default-dodge' className='rounded-md border-[0.5px] border-components-panel-border-subtle bg-background-default-dodge'