From a3a4c50f26b8750ae1c87f1f1103b84b7d2e6315 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 14 Nov 2023 15:11:22 +0100
Subject: refactor(components): replace LinksListWidget with LinksWidget

* avoid List component repeat
* rewrite tests and CSS
* add an id to LinksWidgetItemData (previously LinksListItems) type
because the label could be duplicated
---
 src/pages/recherche/index.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/pages/recherche/index.tsx')

diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index effd087..87e6171 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -8,7 +8,7 @@ import { useIntl } from 'react-intl';
 import {
   getLayout,
   Heading,
-  LinksListWidget,
+  LinksWidget,
   type MetaItemData,
   Notice,
   PageLayout,
@@ -34,7 +34,7 @@ import type {
 import { ROUTES } from '../../utils/constants';
 import {
   getBlogSchema,
-  getLinksListItems,
+  getLinksItemData,
   getPageLinkFromRawData,
   getSchemaJson,
   getWebPageSchema,
@@ -222,13 +222,13 @@ const SearchPage: NextPageWithLayout<SearchPageProps> = ({
         breadcrumbSchema={breadcrumbSchema}
         headerMeta={headerMeta}
         widgets={[
-          <LinksListWidget
+          <LinksWidget
             heading={
               <Heading isFake level={3}>
                 {thematicsListTitle}
               </Heading>
             }
-            items={getLinksListItems(
+            items={getLinksItemData(
               thematicsList.map((thematic) =>
                 getPageLinkFromRawData(thematic, 'thematic')
               )
@@ -236,13 +236,13 @@ const SearchPage: NextPageWithLayout<SearchPageProps> = ({
             // eslint-disable-next-line react/jsx-no-literals -- Key allowed
             key="thematics-list"
           />,
-          <LinksListWidget
+          <LinksWidget
             heading={
               <Heading isFake level={3}>
                 {topicsListTitle}
               </Heading>
             }
-            items={getLinksListItems(
+            items={getLinksItemData(
               topicsList.map((topic) => getPageLinkFromRawData(topic, 'topic'))
             )}
             // eslint-disable-next-line react/jsx-no-literals -- Key allowed
-- 
cgit v1.2.3

