From 0430e3ca0bdf8fd285ce4f84fd05493b5aaaa829 Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 25 May 2025 21:43:34 +0800 Subject: [PATCH] Render link with an image and a description as card --- frontend/src/pages/resource_details_page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/resource_details_page.tsx b/frontend/src/pages/resource_details_page.tsx index 9e8e486..114813a 100644 --- a/frontend/src/pages/resource_details_page.tsx +++ b/frontend/src/pages/resource_details_page.tsx @@ -277,6 +277,7 @@ function Article({resource}: { resource: ResourceDetails }) { } } } + console.log(props.children) // @ts-ignore if (props.children?.length === 2) { // @ts-ignore @@ -284,7 +285,7 @@ function Article({resource}: { resource: ResourceDetails }) { // @ts-ignore const second = props.children[1] as ReactNode - if (typeof first === "object" && typeof second === "string") { + if (typeof first === "object" && (typeof second === "string" || typeof second === "object")) { const img = first as ReactElement // @ts-ignore if (img.type === "img") { @@ -292,7 +293,7 @@ function Article({resource}: { resource: ResourceDetails }) {
{img}
-
+
{second}