Company listing, authentication, and page error handling are all working

This commit is contained in:
2026-02-17 17:29:17 -06:00
parent 6d046e90ed
commit 8e225aa254
23 changed files with 2086 additions and 342 deletions
+69 -152
View File
@@ -1,9 +1,10 @@
<script>
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import "../styles/errorpage.css";
function signOut() {
goto("/logout");
}
$: status = $page.status || 500;
$: message = $page.error?.message || "Something went wrong";
function goBack() {
history.back();
@@ -11,159 +12,75 @@
</script>
<svelte:head>
<title>Error — App</title>
<title>Error {status} — Project Optima</title>
</svelte:head>
<header class="header container">
<h1>Error</h1>
<nav>
<a href="/">Home</a>
<button on:click={signOut}>Sign out</button>
</nav>
</header>
<div class="error-page">
<div class="error-pane">
<!-- Pane header -->
<div class="error-pane-header">
<h2 class="error-pane-title">Error</h2>
<span class="error-status-badge">{status}</span>
</div>
<main class="container">
<section class="error-section">
<div class="error-box">
<h2>Oops! Something went wrong</h2>
<p class="error-message">
We encountered an error while processing your request. Please try again
or contact support if the problem persists.
<!-- Pane body -->
<div class="error-pane-body">
<div class="error-illustration">
<svg viewBox="0 0 120 120" width="120" height="120" aria-hidden="true">
<circle
cx="60"
cy="60"
r="56"
fill="#fef2f2"
stroke="#fecaca"
stroke-width="2"
/>
<circle cx="60" cy="60" r="40" fill="#fee2e2" />
<path
d="M60 35v30"
stroke="#dc2626"
stroke-width="5"
stroke-linecap="round"
/>
<circle cx="60" cy="78" r="4" fill="#dc2626" />
</svg>
</div>
<h3 class="error-heading">Oops! Something went wrong</h3>
<p class="error-message">{message}</p>
<p class="error-hint">
Please try again or contact support if the problem persists.
</p>
<div class="error-actions">
<button class="btn btn-primary" on:click={goBack}>Go Back</button>
<a href="/" class="btn btn-secondary">Go Home</a>
<button class="btn btn-primary" on:click={goBack}>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
width="16"
height="16"
>
<path d="M19 12H5M12 19l-7-7 7-7" />
</svg>
Go Back
</button>
<a href="/" class="btn btn-secondary">
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
width="16"
height="16"
>
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
<polyline points="9 22 9 12 15 12 15 22" />
</svg>
Go Home
</a>
</div>
</div>
</section>
</main>
<footer class="container">
<small>© {new Date().getFullYear()} Your App</small>
</footer>
<style>
:global(body) {
margin: 0;
font-family:
system-ui,
-apple-system,
"Segoe UI",
Roboto,
"Helvetica Neue",
Arial;
background: #f7f7f8;
color: #111;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
}
header {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e5e7eb;
background: #fff;
}
nav {
display: flex;
gap: 0.5rem;
align-items: center;
}
nav a,
nav button {
padding: 0.5rem 1rem;
text-decoration: none;
color: #0066cc;
border: none;
background: none;
cursor: pointer;
font-size: 1rem;
}
nav a:hover,
nav button:hover {
text-decoration: underline;
}
main {
padding: 2rem 1rem;
}
.error-section {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
.error-box {
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 2rem;
max-width: 500px;
text-align: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.error-box h2 {
margin: 0 0 1rem;
color: #d32f2f;
font-size: 1.5rem;
}
.error-message {
color: #666;
margin: 1rem 0 2rem;
line-height: 1.6;
}
.error-actions {
display: flex;
gap: 1rem;
justify-content: center;
}
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
text-decoration: none;
display: inline-block;
transition: all 0.3s ease;
}
.btn-primary {
background: #0066cc;
color: white;
}
.btn-primary:hover {
background: #0052a3;
}
.btn-secondary {
background: #e5e7eb;
color: #111;
}
.btn-secondary:hover {
background: #d1d5db;
}
footer {
text-align: center;
padding: 2rem 1rem;
border-top: 1px solid #e5e7eb;
color: #666;
}
</style>
</div>
</div>