Skip to content

Commit

Permalink
extract common result list content
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrajamanickam-coveo committed Aug 23, 2023
1 parent 1dfa9ff commit b0d5c41
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ export default function SearchPage({ssrState}: {ssrState: SearchSSRState}) {
});
}, [ssrState]);

const content = (
<>
<ResultList />
<HydrationMetadata ssrState={ssrState} csrResult={csrResult} />
</>
);

if (csrResult) {
return (
<CSRProvider
engine={csrResult.engine}
controllers={csrResult.controllers}
>
<ResultList />
<HydrationMetadata ssrState={ssrState} csrResult={csrResult} />
{content}
</CSRProvider>
);
} else {
return (
<SSRStateProvider controllers={ssrState.controllers}>
<ResultList />
<HydrationMetadata ssrState={ssrState} csrResult={csrResult} />
{content}
</SSRStateProvider>
);
}
Expand Down

0 comments on commit b0d5c41

Please sign in to comment.