2025-06-22 00:21:09 +03:00

24 lines
2.1 KiB
JavaScript

import { s as subscribe } from "../../chunks/utils.js";
import { c as create_ssr_component, e as escape, a as add_attribute } from "../../chunks/ssr.js";
import { p as page } from "../../chunks/stores.js";
const Error = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let errorMessage;
let errorCode;
let $page, $$unsubscribe_page;
$$unsubscribe_page = subscribe(page, (value) => $page = value);
let { status = 500 } = $$props;
let { error = null } = $$props;
let countdown = 3;
if ($$props.status === void 0 && $$bindings.status && status !== void 0) $$bindings.status(status);
if ($$props.error === void 0 && $$bindings.error && error !== void 0) $$bindings.error(error);
errorMessage = error?.message || "An unexpected error occurred";
errorCode = status || 500;
$$unsubscribe_page();
return ` <div class="hero min-h-screen bg-base-200"><div class="hero-content text-center"><div class="max-w-md">${errorCode === 404 ? `<div><div class="text-6xl font-bold text-red-600 mb-4">${escape(errorCode)}</div> <h1 class="text-2xl font-bold text-gray-900 mb-4" data-svelte-h="svelte-1mxg8rr">Page Not Found</h1> <p class="text-gray-600 mb-6">The page ${escape($page.url.pathname)} was not found.
<br><br>
You will be redirected to the app in ${escape(countdown)} seconds.</p> <progress class="progress progress-primary w-56"${add_attribute("value", 3 - countdown, 0)} max="3"></progress> <div class="mt-4" data-svelte-h="svelte-1hnwq62"><a href="/auto-login" class="btn btn-primary">Go to App</a></div></div>` : `${errorCode >= 500 ? `<h1 class="text-2xl font-bold text-gray-900 mb-4" data-svelte-h="svelte-1uyrdxw">Server Error</h1> <p class="text-gray-600 mb-6" data-svelte-h="svelte-1bjr7x4">Something went wrong on our end.</p>` : `<h1 class="text-2xl font-bold text-gray-900 mb-4" data-svelte-h="svelte-nf7wkh">Error</h1> <p class="text-gray-600 mb-6">${escape(errorMessage)}</p>`}`} <a href="/auto-login" class="btn btn-primary" data-svelte-h="svelte-qorsu">Go to Auto-Login</a></div></div></div>`;
});
export {
Error as default
};