Skip to content

Commit 8205e8a

Browse files
committed
fix: fixed display issue of labels on data set cards
1 parent 926898a commit 8205e8a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

frontend/src/components/CardView.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import ActionDropdown from "./ActionDropdown";
77
import { Database } from "lucide-react";
88

99
interface BadgeItem {
10+
name: string;
1011
label: string;
1112
color?: string;
1213
background?: string;
@@ -84,7 +85,7 @@ const TagsRenderer = ({ tags }: { tags?: Array<string | BadgeItem> }) => {
8485
if (typeof tag === "string") {
8586
tagElement.textContent = tag;
8687
} else {
87-
tagElement.textContent = tag.label;
88+
tagElement.textContent = tag.label ? tag.label : tag.name;
8889
}
8990
tempDiv.appendChild(tagElement);
9091
tagElements.push(tagElement);
@@ -145,7 +146,7 @@ const TagsRenderer = ({ tags }: { tags?: Array<string | BadgeItem> }) => {
145146
: { background: tag.background, color: tag.color }
146147
}
147148
>
148-
{typeof tag === "string" ? tag : tag.label}
149+
{typeof tag === "string" ? tag : (tag.label ? tag.label : tag.name)}
149150
</Tag>
150151
))}
151152
</div>
@@ -164,7 +165,7 @@ const TagsRenderer = ({ tags }: { tags?: Array<string | BadgeItem> }) => {
164165
: { background: tag.background, color: tag.color }
165166
}
166167
>
167-
{typeof tag === "string" ? tag : tag.label}
168+
{typeof tag === "string" ? tag : (tag.label ? tag.label : tag.name)}
168169
</Tag>
169170
))}
170171
{hiddenTags.length > 0 && (
@@ -255,7 +256,7 @@ function CardView<T extends BaseCardDataType>(props: CardViewProps<T>) {
255256
color: item.tags[0].color,
256257
}}
257258
>
258-
{item.tags[0].label}
259+
{item.tags[0].label ? item.tags[0].label : item.tags[0].name}
259260
</Tag>
260261
)}
261262
{item?.status && (

0 commit comments

Comments
 (0)