From 58d49767f4b68fa3f00ad1a51750d4a97b9067bf Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 11 Feb 2024 00:15:59 -0800
Subject: fix(error): use path store

---
 src/routes/+error.svelte | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

(limited to 'src/routes/+error.svelte')

diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte
index e8b9d0f1..03e5bfc0 100644
--- a/src/routes/+error.svelte
+++ b/src/routes/+error.svelte
@@ -1,8 +1,9 @@
 <script lang="ts">
-	import { browser } from '$app/environment';
+	import { page } from '$app/stores';
 	import { closest } from '$lib/Error/path';
+	import Popup from '$lib/Popup.svelte';
 
-	$: suggestion = closest(browser ? window.location.pathname : '...', [
+	$: suggestion = closest($page.url.pathname, [
 		'birthdays',
 		'completed',
 		'schedule',
@@ -15,12 +16,16 @@
 	]);
 </script>
 
-<p>Page not found.</p>
+<Popup>
+	<p style="text-align: center;">
+		<a href={$page.url.pathname}>{$page.url.pathname}</a> not found
+	</p>
 
-<blockquote>
-	Did you mean "<a
-		href={suggestion}
-		style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
-		>{suggestion.charAt(0).toUpperCase() + suggestion.slice(1)}</a
-	>"?
-</blockquote>
+	<blockquote style="margin: 0 0 0 1.5rem;">
+		Did you mean "<a
+			href={suggestion}
+			style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
+			>{suggestion.charAt(0).toUpperCase() + suggestion.slice(1)}</a
+		>"?
+	</blockquote>
+</Popup>
-- 
cgit v1.2.3

