From c46d80d310795d0088ba9b4fcd8f74b83885d6d8 Mon Sep 17 00:00:00 2001 From: nyne Date: Fri, 30 May 2025 22:58:33 +0800 Subject: [PATCH] Limit displayed tags to a maximum of 10 in ResourceCard --- frontend/src/components/resource_card.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/resource_card.tsx b/frontend/src/components/resource_card.tsx index 04d6c13..f85c1fa 100644 --- a/frontend/src/components/resource_card.tsx +++ b/frontend/src/components/resource_card.tsx @@ -6,6 +6,11 @@ import Badge from "./badge.tsx"; export default function ResourceCard({ resource }: { resource: Resource }) { const navigate = useNavigate() + let tags = resource.tags + if (tags.length > 10) { + tags = tags.slice(0, 10) + } + return
{ navigate(`/resources/${resource.id}`) }}> @@ -25,7 +30,7 @@ export default function ResourceCard({ resource }: { resource: Resource }) {

{ - resource.tags.map((tag) => { + tags.map((tag) => { return {tag.name} }) }