This commit is contained in:
ditiqi 2025-03-06 22:34:18 +08:00
parent e60c5000f4
commit 48706e79eb
1 changed files with 23 additions and 17 deletions

View File

@ -6,24 +6,30 @@ const TermInfo = ({ terms = [] }: { terms?: TermDto[] }) => {
<div>
{terms && terms?.length > 0 ? (
<div className="flex gap-2 mb-4">
{terms?.map((term: any) => {
return (
<Tag
key={term.id}
color={
term?.taxonomy?.slug ===
{terms
?.sort((a, b) =>
String(a?.taxonomy?.id || "").localeCompare(
String(b?.taxonomy?.id || "")
)
)
?.map((term: any) => {
return (
<Tag
key={term.id}
color={
term?.taxonomy?.slug ===
TaxonomySlug.CATEGORY
? "green"
: term?.taxonomy?.slug ===
TaxonomySlug.LEVEL
? "blue"
: "orange"
}
className="px-3 py-1 rounded-full border-0">
{term.name}
</Tag>
);
})}
? "green"
: term?.taxonomy?.slug ===
TaxonomySlug.LEVEL
? "blue"
: "orange"
}
className="px-3 py-1 rounded-full border-0">
{term.name}
</Tag>
);
})}
</div>
) : (
<div className="flex gap-2 mb-4">