'use client' import type { FC } from 'react' import React from 'react' import { useContext } from 'use-context-selector' import ExploreContext from '@/context/explore-context' import TextGenerationApp from '@/app/components/share/text-generation' import Loading from '@/app/components/base/loading' import ChatWithHistory from '@/app/components/base/chat/chat-with-history' export type IInstalledAppProps = { id: string } const InstalledApp: FC = ({ id, }) => { const { installedApps } = useContext(ExploreContext) const installedApp = installedApps.find(item => item.id === id) if (!installedApp) { return (
) } return (
{installedApp.app.mode !== 'completion' && installedApp.app.mode !== 'workflow' && ( )} {installedApp.app.mode === 'completion' && ( )} {installedApp.app.mode === 'workflow' && ( )}
) } export default React.memo(InstalledApp)