search: add results counter with styling

This commit is contained in:
2024-08-09 15:46:31 +02:00
parent 229fece375
commit e98aa722bb
2 changed files with 11 additions and 2 deletions
@@ -55,7 +55,7 @@ const PAGE_TYPES: Record<string, string> = {
function SearchResults({ results }: { results: any }) {
if (!results.length) {
return <div>Ingen resultater 😔</div>;
return <div className={styles.noResults}>Ingen resultater</div>;
}
const supportedResults = results.filter(
(result: any) =>
@@ -63,6 +63,7 @@ function SearchResults({ results }: { results: any }) {
);
return (
<div>
<p className={styles.resultsCounter}>{results.length} resultater</p>
{supportedResults.map((result: any) => {
let resultType = PAGE_TYPES[result.__typename] ?? "";
if (result.__typename === "AssociationPage") {