|
2 | 2 | import { page } from '$app/stores'; |
3 | 3 | import { MetaTags } from '$lib/components/seo'; |
4 | 4 | import { Card } from '$lib/components/ui'; |
5 | | - import { Home, RefreshCw, FileQuestion, Shield, ServerCrash, AlertTriangle } from '@lucide/svelte'; |
| 5 | + import { |
| 6 | + Home, |
| 7 | + RefreshCw, |
| 8 | + FileQuestion, |
| 9 | + Shield, |
| 10 | + ServerCrash, |
| 11 | + AlertTriangle |
| 12 | + } from '@lucide/svelte'; |
6 | 13 |
|
7 | 14 | // Get error details from page store |
8 | 15 | const status = $derived($page.status); |
|
29 | 36 | return { |
30 | 37 | icon: Shield, |
31 | 38 | title: 'Access Denied', |
32 | | - description: 'You don\'t have permission to access this resource. This could be due to authentication requirements or restricted access.', |
| 39 | + description: |
| 40 | + "You don't have permission to access this resource. This could be due to authentication requirements or restricted access.", |
33 | 41 | suggestions: [ |
34 | | - 'Make sure you\'re logged in if required', |
| 42 | + "Make sure you're logged in if required", |
35 | 43 | 'The content may be private or restricted', |
36 | 44 | 'Contact the site owner if you believe this is an error' |
37 | 45 | ], |
|
42 | 50 | return { |
43 | 51 | icon: ServerCrash, |
44 | 52 | title: 'Something Went Wrong', |
45 | | - description: 'An internal error occurred while processing your request. This is usually temporary.', |
| 53 | + description: |
| 54 | + 'An internal error occurred while processing your request. This is usually temporary.', |
46 | 55 | suggestions: [ |
47 | 56 | 'Try refreshing the page', |
48 | 57 | 'Clear your browser cache', |
49 | 58 | 'The issue has been logged and will be investigated' |
50 | 59 | ], |
51 | | - primaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() }, |
| 60 | + primaryAction: { |
| 61 | + label: 'Try Again', |
| 62 | + href: null, |
| 63 | + icon: RefreshCw, |
| 64 | + action: () => window.location.reload() |
| 65 | + }, |
52 | 66 | secondaryAction: { label: 'Go to Homepage', href: '/', icon: Home } |
53 | 67 | }; |
54 | 68 | case 503: |
55 | 69 | return { |
56 | 70 | icon: AlertTriangle, |
57 | 71 | title: 'Service Temporarily Unavailable', |
58 | | - description: 'The server is currently unavailable, usually due to maintenance or high load. Please try again shortly.', |
| 72 | + description: |
| 73 | + 'The server is currently unavailable, usually due to maintenance or high load. Please try again shortly.', |
59 | 74 | suggestions: [ |
60 | 75 | 'Wait a few moments and try again', |
61 | 76 | 'The site may be undergoing maintenance', |
62 | 77 | 'Check back in a minute or two' |
63 | 78 | ], |
64 | | - primaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() }, |
| 79 | + primaryAction: { |
| 80 | + label: 'Try Again', |
| 81 | + href: null, |
| 82 | + icon: RefreshCw, |
| 83 | + action: () => window.location.reload() |
| 84 | + }, |
65 | 85 | secondaryAction: { label: 'Go to Homepage', href: '/', icon: Home } |
66 | 86 | }; |
67 | 87 | default: |
|
75 | 95 | 'If the problem persists, please contact support' |
76 | 96 | ], |
77 | 97 | primaryAction: { label: 'Go to Homepage', href: '/', icon: Home }, |
78 | | - secondaryAction: { label: 'Try Again', href: null, icon: RefreshCw, action: () => window.location.reload() } |
| 98 | + secondaryAction: { |
| 99 | + label: 'Try Again', |
| 100 | + href: null, |
| 101 | + icon: RefreshCw, |
| 102 | + action: () => window.location.reload() |
| 103 | + } |
79 | 104 | }; |
80 | 105 | } |
81 | 106 | }); |
|
98 | 123 | <div class="text-center"> |
99 | 124 | <!-- Icon with status code --> |
100 | 125 | <div class="mb-6 flex flex-col items-center"> |
101 | | - <div class="mb-4 rounded-full bg-primary-100 p-6 text-primary-600 dark:bg-primary-900/30 dark:text-primary-400"> |
| 126 | + <div |
| 127 | + class="mb-4 rounded-full bg-primary-100 p-6 text-primary-600 dark:bg-primary-900/30 dark:text-primary-400" |
| 128 | + > |
102 | 129 | {#if errorConfig.icon === FileQuestion} |
103 | 130 | <FileQuestion class="h-16 w-16" /> |
104 | 131 | {:else if errorConfig.icon === Shield} |
|
127 | 154 | <!-- Show additional error message if available and meaningful --> |
128 | 155 | {#if errorMessage && !errorMessage.includes('Internal Error') && status !== 404} |
129 | 156 | <div class="mb-6 rounded-lg bg-red-50 p-4 text-left dark:bg-red-900/20"> |
130 | | - <p class="text-sm font-medium text-red-800 dark:text-red-200"> |
131 | | - Error details: |
132 | | - </p> |
| 157 | + <p class="text-sm font-medium text-red-800 dark:text-red-200">Error details:</p> |
133 | 158 | <p class="mt-1 font-mono text-sm text-red-700 dark:text-red-300"> |
134 | 159 | {errorMessage} |
135 | 160 | </p> |
|
139 | 164 | <!-- Suggestions --> |
140 | 165 | {#if errorConfig.suggestions.length > 0} |
141 | 166 | <div class="mb-8 text-left"> |
142 | | - <p class="mb-3 text-sm font-medium text-ink-600 dark:text-ink-400"> |
143 | | - What you can try: |
144 | | - </p> |
| 167 | + <p class="mb-3 text-sm font-medium text-ink-600 dark:text-ink-400">What you can try:</p> |
145 | 168 | <ul class="space-y-2"> |
146 | 169 | {#each errorConfig.suggestions as suggestion} |
147 | 170 | <li class="flex items-start gap-2 text-sm text-ink-700 dark:text-ink-300"> |
|
226 | 249 | Archive |
227 | 250 | </a> |
228 | 251 | <a |
229 | | - href="/github" |
| 252 | + href="/work" |
230 | 253 | class="rounded-lg bg-canvas-100 px-4 py-2 text-sm text-ink-700 transition-colors hover:bg-canvas-200 dark:bg-canvas-800 dark:text-ink-300 dark:hover:bg-canvas-700" |
231 | 254 | > |
232 | | - GitHub |
| 255 | + Work |
233 | 256 | </a> |
234 | 257 | <a |
235 | 258 | href="/site/meta" |
|
0 commit comments