Files
site/app/error.jsx
Claude 6310bb67c4 System: tabs, sheet, loading/empty/error states, media rules, error pages, canonical, sitemap
- kit.jsx: Tabs + TabPanel (gliding pill, arrow keys, panels kept in HTML), Sheet (controlled,
  focus in and back, Esc, drag-down on phones), Skeleton, Empty, Problem, Img (LCP and lazy
  rules), Film (plays only on screen, never under reduced motion or Data Saver)
- ui.jsx: Lines (the one line-mask headline reveal), Btn busy/disabled/selected
- app/error.jsx and app/global-error.jsx in the 404's dark room
- JsonLd: canonical link on every page; app/sitemap.js, app/robots.js, app/icon.svg
- system.css: token names that cannot clash with hanzo.css; hover that is safe on any colours

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DqUybA3gCfaruBE8tifYd5
2026-11-07 13:41:39 +00:00

25 lines
1.4 KiB
React

'use client';
/* The error state for every page: if a page throws while rendering, this replaces it (header and footer stay), in the
same dark room as the 404. "Try again" re-renders the page; "Go home" leaves. Pages need nothing. */
import { useEffect } from 'react';
import { motion } from 'motion/react';
import { A } from '../components/kit';
import { EASE } from '../components/ui';
import '../components/pages/Lost.css';
export default function PageError({ error, reset }) {
useEffect(() => { console.error(error); dispatchEvent(new CustomEvent('hz-event', { detail: { name: 'page_error', path: location.pathname, message: String(error?.message || '') } })); }, [error]);
const rise = (d) => ({ initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.8, ease: EASE, delay: d } });
return (
<main className="xlo" data-room="dark" data-ask="off">
<section className="xlo-in x-wrap">
<h1 className="xlo-h1"><span className="x-line"><motion.span className="x-line-in" initial={{ y: '105%' }} animate={{ y: 0 }} transition={{ duration: 1.1, ease: EASE }}>This page didn&apos;t load.</motion.span></span></h1>
<motion.div className="xlo-acts" {...rise(0.3)}>
<button type="button" className="x-btn solid" onClick={() => reset()}>Try again</button>
<A to="/" className="x-btn">Go home</A>
</motion.div>
</section>
</main>
);
}