From 39f71f5d7d60235d490c2e7d648ffeb452062b2c Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:35:02 -0400 Subject: [PATCH] apm: remove chip from searchitem --- .../src/components/Search/SearchItem.tsx | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/packages/ui-components/src/components/Search/SearchItem.tsx b/packages/ui-components/src/components/Search/SearchItem.tsx index 5606122c2..a94342821 100644 --- a/packages/ui-components/src/components/Search/SearchItem.tsx +++ b/packages/ui-components/src/components/Search/SearchItem.tsx @@ -9,6 +9,7 @@ import Stack from '@mui/material/Stack'; import React from 'react'; import { useTranslation } from 'react-i18next'; +import { useConfig } from '../../'; import { cleanDescription } from './utils'; type SearchItemProps = { @@ -74,6 +75,7 @@ const SearchItem: React.FC = ({ ...props }) => { const { t } = useTranslation(); + const { configOptions } = useConfig(); const handleDelete = () => { // no action assigned by default }; @@ -87,37 +89,39 @@ const SearchItem: React.FC = ({ {version && {version}} - - - {isPrivate && ( - } - label={t('search.isPrivate')} - onDelete={handleDelete} - size="small" - /> - )} - {isRemote && !isPrivate && ( - } - label={t('search.isRemote')} - onDelete={handleDelete} - size="small" - variant="outlined" - /> - )} - {isCached && ( - } - label={t('search.isCached')} - onDelete={handleDelete} - size="small" - variant="outlined" - /> - )} - - + {configOptions?.showUplinks && ( + + + {isPrivate && ( + } + label={t('search.isPrivate')} + onDelete={handleDelete} + size="small" + /> + )} + {isRemote && !isPrivate && ( + } + label={t('search.isRemote')} + onDelete={handleDelete} + size="small" + variant="outlined" + /> + )} + {isCached && ( + } + label={t('search.isCached')} + onDelete={handleDelete} + size="small" + variant="outlined" + /> + )} + + + )} ); };