aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/recherche
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/recherche')
-rw-r--r--src/pages/recherche/index.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index 647d049..771bd3b 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -47,6 +47,11 @@ const Search: NextPageWithLayout = () => {
getKey,
getPublishedPosts
);
+ const [totalPostsCount, setTotalPostsCount] = useState<number>(0);
+
+ useEffect(() => {
+ if (data) setTotalPostsCount(data[0].pageInfo.total);
+ }, [data]);
const isLoadingInitialData = !data && !error;
const isLoadingMore: boolean =
@@ -95,7 +100,7 @@ const Search: NextPageWithLayout = () => {
<article
className={`${styles.article} ${styles['article--no-comments']}`}
>
- <PostHeader title={title} />
+ <PostHeader title={title} meta={{ results: totalPostsCount }} />
<div className={styles.body}>
{getPostsList()}
{hasNextPage && (