0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-13 22:48:31 -05:00

apm: remove chip from searchitem

This commit is contained in:
Marc Bernard 2024-07-17 11:35:02 -04:00
parent a985ddc246
commit 39f71f5d7d

View file

@ -9,6 +9,7 @@ import Stack from '@mui/material/Stack';
import React from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useConfig } from '../../';
import { cleanDescription } from './utils'; import { cleanDescription } from './utils';
type SearchItemProps = { type SearchItemProps = {
@ -74,6 +75,7 @@ const SearchItem: React.FC<SearchItemProps> = ({
...props ...props
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { configOptions } = useConfig();
const handleDelete = () => { const handleDelete = () => {
// no action assigned by default // no action assigned by default
}; };
@ -87,37 +89,39 @@ const SearchItem: React.FC<SearchItemProps> = ({
</NameGroup> </NameGroup>
{version && <Version>{version}</Version>} {version && <Version>{version}</Version>}
</Wrapper> </Wrapper>
<Wrapper> {configOptions?.showUplinks && (
<Stack direction="row" spacing={1}> <Wrapper>
{isPrivate && ( <Stack direction="row" spacing={1}>
<Chip {isPrivate && (
color="primary" <Chip
deleteIcon={<HttpsIcon />} color="primary"
label={t('search.isPrivate')} deleteIcon={<HttpsIcon />}
onDelete={handleDelete} label={t('search.isPrivate')}
size="small" onDelete={handleDelete}
/> size="small"
)} />
{isRemote && !isPrivate && ( )}
<Chip {isRemote && !isPrivate && (
deleteIcon={<SyncAlt />} <Chip
label={t('search.isRemote')} deleteIcon={<SyncAlt />}
onDelete={handleDelete} label={t('search.isRemote')}
size="small" onDelete={handleDelete}
variant="outlined" size="small"
/> variant="outlined"
)} />
{isCached && ( )}
<Chip {isCached && (
deleteIcon={<Cached />} <Chip
label={t('search.isCached')} deleteIcon={<Cached />}
onDelete={handleDelete} label={t('search.isCached')}
size="small" onDelete={handleDelete}
variant="outlined" size="small"
/> variant="outlined"
)} />
</Stack> )}
</Wrapper> </Stack>
</Wrapper>
)}
</li> </li>
); );
}; };