From cc2c4cf314d3c0fbd9946789016f879b3267c216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=98=E8=8F=98?= Date: Wed, 5 Jul 2023 21:35:28 +0800 Subject: [PATCH] fix: resource title --- components/Search/SearchResultList/Item/index.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/Search/SearchResultList/Item/index.jsx b/components/Search/SearchResultList/Item/index.jsx index d77e067a..1865187a 100644 --- a/components/Search/SearchResultList/Item/index.jsx +++ b/components/Search/SearchResultList/Item/index.jsx @@ -102,13 +102,11 @@ const Item = ({ data, queryTags }) => { [data], ); - const title = useMemo( - () => - (data?.properties['資源名稱']?.title ?? []).find( - (item) => item?.type === 'text', - )?.plain_text, - [data?.properties], - ); + const titleTextList = (data?.properties['資源名稱']?.title ?? []) + .filter((item) => item?.type === 'text') + .map((item) => item?.plain_text); + + const title = useMemo(() => titleTextList.join(''), [data?.properties]); const contributors = useMemo( () => data?.properties['創建者']?.multi_select ?? [],