Skip to content

Commit 9f2e8d5

Browse files
committed
add no results found to search
1 parent 44430db commit 9f2e8d5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

i18n/en.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,7 @@ other = "Medium risk"
9292
other = "Low risk"
9393

9494
[search-type-to-start]
95-
other = "Type to start searching"
95+
other = "Type to start searching"
96+
97+
[search-no-results]
98+
other = "No results found"

i18n/nl.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,7 @@ other = "Medium risico"
9292
other = "Laag risico"
9393

9494
[search-type-to-start]
95-
other = "Typ om te beginnen met zoeken"
95+
other = "Typ om te beginnen met zoeken"
96+
97+
[search-no-results]
98+
other = "Geen resultaten gevonden"

layouts/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ <h2 class="pt-5 color-blue">Search</h2>
159159
return;
160160
}
161161

162+
if(!items || !items.length > 0) {
163+
container.querySelector('ol').innerHTML = `<p>{{i18n "search-no-results"}}</p>`;
164+
return;
165+
}
166+
162167
container.querySelector('ol').innerHTML = items
163168
.map(
164169
item => {

0 commit comments

Comments
 (0)