Add analytics & privacy-policy

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-03-16 22:02:50 +01:00
parent 9b8ce076bf
commit 838d194164
6 changed files with 94 additions and 2 deletions

View File

@@ -75,6 +75,9 @@
results = data.results;
totalPages = data.pagination.totalPages;
totalResults = data.pagination.totalResults;
if (typeof window !== "undefined" && (window as any).umami) {
(window as any).umami.track("search", { query: lastQuery, results: totalResults });
}
} catch (e) {
console.error("Search error:", e);
results = [];
@@ -124,7 +127,7 @@
{:else if results.length > 0}
<ul class="list rounded-box">
<li class="px-4 pb-2 text-xs opacity-60 tracking-wide">
{totalResults} result{totalResults > 1 && "s" || ""} for the query '{cleanUserInput(
{totalResults} result{(totalResults > 1 && "s") || ""} for the query '{cleanUserInput(
lastQuery,
)}'
</li>
@@ -152,7 +155,7 @@
</div>
{/if}
{:else}
<NotFoundView lastQuery={lastQuery} />
<NotFoundView {lastQuery} />
{/if}
</div>
</div>