'use client' import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen' import { zIconType } from '@dify/contracts/api/console/apps/zod.gen' import { cn } from '@langgenius/dify-ui/cn' import { useTranslation } from 'react-i18next' import AppIcon from '@/app/components/base/app-icon' type AppTriggerProps = { open: boolean appDetail?: Pick< AppPartial, 'icon' | 'icon_background' | 'icon_type' | 'icon_url' | 'id' | 'name' > } export function AppTrigger({ open, appDetail }: AppTriggerProps) { const { t } = useTranslation() const appIconType = zIconType.safeParse(appDetail?.icon_type).data ?? null return ( {appDetail && ( )} {appDetail ? ( {appDetail.name} ) : ( {t(($) => $['appSelector.placeholder'], { ns: 'app' })} )} ) }