Phase 8, third batch: the three root components and both layouts. All five emit byte-identical JavaScript and the production bundle is byte-identical to3d5f54b. Small batch, and almost all of it was the rename. `ScrollToTop`, `UserNotRegisteredError` and both layouts take no props at all - the layouts render through `<Outlet />` - so inference already described them. `ProtectedRoute` gains the only real interface, and it clears a standing error. Both its props have fallbacks - `fallback` defaults to a spinner and `unauthenticatedElement` falls through `??` to the login redirect - and its one call site is a bare `<ProtectedRoute />` in `App.jsx`. Typed optional, which is what the defaults already said, that call site stops being an error: tsc goes 22 -> 21 with nothing introduced. The auth boundary itself is untouched. The `authError.type === 'user_not_registered'` branch, the `<Navigate to="/admin/login" state={{ from }}>` redirect and the `isLoadingAuth || !authChecked` gate are all exactly as they were - which matters, because `AdminLayout` is one of the files `skill-check.mjs` reads as source text, and it is read through the resolver added in02a2ab0. Verified: tsc 22 -> 21, set-difference showing one removed and none added; zero errors in any of the five; all five emit byte-identical JavaScript; production bundle byte-identical; npm test 1684/1691 with the same seven failures; Owliver baseline 59/59; lint 0 errors; baseline artifacts untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBG1wnuRfJKCstGB8Fekr8
32 lines
1.6 KiB
TypeScript
32 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
|
|
const UserNotRegisteredError = () => {
|
|
return (
|
|
<div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50">
|
|
<div className="max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100">
|
|
<div className="text-center">
|
|
<div className="inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100">
|
|
<svg className="w-8 h-8 text-orange-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
|
</svg>
|
|
</div>
|
|
<h1 className="text-3xl font-bold text-slate-900 mb-4">Access Restricted</h1>
|
|
<p className="text-slate-600 mb-8">
|
|
You are not registered to use this application. Please contact the app administrator to request access.
|
|
</p>
|
|
<div className="p-4 bg-slate-50 rounded-md text-sm text-slate-600">
|
|
<p>If you believe this is an error, you can:</p>
|
|
<ul className="list-disc list-inside mt-2 space-y-1">
|
|
<li>Verify you are logged in with the correct account</li>
|
|
<li>Contact the app administrator for access</li>
|
|
<li>Try logging out and back in again</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default UserNotRegisteredError;
|