diff --git a/apps/chat/src/components/Common/NoResultsFound.tsx b/apps/chat/src/components/Common/NoResultsFound.tsx index ea66ba829..9e7d59da4 100644 --- a/apps/chat/src/components/Common/NoResultsFound.tsx +++ b/apps/chat/src/components/Common/NoResultsFound.tsx @@ -1,17 +1,35 @@ import { useTranslation } from 'next-i18next'; +import classNames from 'classnames'; + import { Translation } from '@/src/types/translation'; import Magnifier from '../../../public/images/icons/search-alt.svg'; -export const NoResultsFound = () => { +interface NoResultsFoundProps { + iconSize?: number; + className?: string; +} + +export const NoResultsFound = ({ + iconSize = 60, + className = 'text-sm gap-3', +}: NoResultsFoundProps) => { const { t } = useTranslation(Translation.Common); + return (
- + {t('No results found')}
); diff --git a/apps/chat/src/components/Marketplace/ApplicationCard.tsx b/apps/chat/src/components/Marketplace/ApplicationCard.tsx index 80a06ccce..27f545f9d 100644 --- a/apps/chat/src/components/Marketplace/ApplicationCard.tsx +++ b/apps/chat/src/components/Marketplace/ApplicationCard.tsx @@ -20,9 +20,7 @@ import { DialAIEntityModel } from '@/src/types/models'; import { Translation } from '@/src/types/translation'; import { useAppSelector } from '@/src/store/hooks'; -import { MarketplaceSelectors } from '@/src/store/marketplace/marketplace.reducers'; - -import { MarketplaceTabs } from '@/src/constants/marketplace'; +import { ModelsSelectors } from '@/src/store/models/models.reducers'; import { ModelIcon } from '@/src/components/Chatbar/ModelIcon'; import ContextMenu from '@/src/components/Common/ContextMenu'; @@ -81,12 +79,14 @@ export const ApplicationCard = ({ }: ApplicationCardProps) => { const { t } = useTranslation(Translation.Marketplace); - const selectedTab = useAppSelector(MarketplaceSelectors.selectSelectedTab); - const isMyEntity = entity.id.startsWith( getRootId({ featureType: FeatureType.Application }), ); + const installedModelIds = useAppSelector( + ModelsSelectors.selectInstalledModelIds, + ); + const menuItems: DisplayMenuItemProps[] = useMemo( () => [ { @@ -135,9 +135,7 @@ export const ApplicationCard = ({ name: t('Remove'), dataQa: 'remove', display: - !isMyEntity && - selectedTab === MarketplaceTabs.MY_APPLICATIONS && - !!onRemove, + !isMyEntity && installedModelIds.has(entity.reference) && !!onRemove, Icon: (props: TablerIconsProps) => ( ), @@ -147,7 +145,17 @@ export const ApplicationCard = ({ }, }, ], - [entity, onPublish, t, selectedTab, onDelete, isMyEntity, onEdit, onRemove], + + [ + t, + isMyEntity, + onEdit, + onPublish, + entity, + onDelete, + installedModelIds, + onRemove, + ], ); const iconSize = diff --git a/apps/chat/src/components/Marketplace/ApplicationDetails/ApplicationFooter.tsx b/apps/chat/src/components/Marketplace/ApplicationDetails/ApplicationFooter.tsx index 4ac975ee8..7111c4233 100644 --- a/apps/chat/src/components/Marketplace/ApplicationDetails/ApplicationFooter.tsx +++ b/apps/chat/src/components/Marketplace/ApplicationDetails/ApplicationFooter.tsx @@ -14,6 +14,9 @@ import { FeatureType } from '@/src/types/common'; import { DialAIEntityModel } from '@/src/types/models'; import { Translation } from '@/src/types/translation'; +import { useAppSelector } from '@/src/store/hooks'; +import { ModelsSelectors } from '@/src/store/models/models.reducers'; + import { ModelVersionSelect } from '../../Chat/ModelVersionSelect'; import Tooltip from '../../Common/Tooltip'; @@ -35,7 +38,6 @@ interface Props { export const ApplicationDetailsFooter = ({ entity, allVersions, - isMyAppsTab, onChangeVersion, onPublish, onUseEntity, @@ -49,6 +51,9 @@ export const ApplicationDetailsFooter = ({ getRootId({ featureType: FeatureType.Application }), ); const isPublicApp = isEntityPublic(entity); + const installedModelIds = useAppSelector( + ModelsSelectors.selectInstalledModelIds, + ); return (
@@ -58,7 +63,7 @@ export const ApplicationDetailsFooter = ({ className="shrink-0 text-accent-primary md:hidden [&_path]:fill-current" size={24} /> */} - {(isMyAppsTab || isMyApp) && ( + {(isMyApp || installedModelIds.has(entity.reference)) && (