-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: gh-141 docs list item show special attributes badges.
Only for table & grid layouts with "filterableAttributes" & "searchableAttributes" & "sortableAttributes".
- Loading branch information
Showing
7 changed files
with
91 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use client'; | ||
import { Tooltip } from '@arco-design/web-react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Tag } from '@douyinfe/semi-ui'; | ||
import { Settings } from 'meilisearch'; | ||
|
||
export const AttrTags = ({ attr, indexSettings }: { attr: string; indexSettings: Settings }) => { | ||
const { t } = useTranslation('index'); | ||
|
||
return ( | ||
<> | ||
{indexSettings?.filterableAttributes?.includes(attr) && ( | ||
<Tooltip content={t('index:setting.filterableAttributes')}> | ||
<Tag size="small" color="amber"> | ||
FL | ||
</Tag> | ||
</Tooltip> | ||
)} | ||
{indexSettings?.searchableAttributes?.includes(attr) && ( | ||
<Tooltip content={t('index:setting.searchableAttributes')}> | ||
<Tag size="small" color="indigo"> | ||
SC | ||
</Tag> | ||
</Tooltip> | ||
)} | ||
{indexSettings?.sortableAttributes?.includes(attr) && ( | ||
<Tooltip content={t('index:setting.sortableAttributes')}> | ||
<Tag size="small" color="cyan"> | ||
ST | ||
</Tag> | ||
</Tooltip> | ||
)} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters