'use client' import { useTranslation } from 'react-i18next' import { PlusIcon } from '@heroicons/react/20/solid' import Button from '../../base/button' import cn from '@/utils/classnames' import type { App } from '@/models/explore' import AppIcon from '@/app/components/base/app-icon' import { AiText, ChatBot, CuteRobot } from '@/app/components/base/icons/src/vender/solid/communication' import { Route } from '@/app/components/base/icons/src/vender/solid/mapsAndTravel' export type AppCardProps = { app: App canCreate: boolean onCreate: () => void isExplore: boolean } const AppCard = ({ app, canCreate, onCreate, isExplore, }: AppCardProps) => { const { t } = useTranslation() const { app: appBasicInfo } = app return (
{appBasicInfo.mode === 'advanced-chat' && ( )} {appBasicInfo.mode === 'agent-chat' && ( )} {appBasicInfo.mode === 'chat' && ( )} {appBasicInfo.mode === 'completion' && ( )} {appBasicInfo.mode === 'workflow' && ( )}
{appBasicInfo.name}
{appBasicInfo.mode === 'advanced-chat' &&
{t('app.types.chatbot').toUpperCase()}
} {appBasicInfo.mode === 'chat' &&
{t('app.types.chatbot').toUpperCase()}
} {appBasicInfo.mode === 'agent-chat' &&
{t('app.types.agent').toUpperCase()}
} {appBasicInfo.mode === 'workflow' &&
{t('app.types.workflow').toUpperCase()}
} {appBasicInfo.mode === 'completion' &&
{t('app.types.completion').toUpperCase()}
}
{app.description}
{isExplore && canCreate && (
)} {!isExplore && (
)}
) } export default AppCard