/* ═══════════════════════════════════════════════════════════════ PAGE STATE The three ways a detail page can fail to be a detail page. All four of them need the same thing, and it should be the same thing — a visitor who hits a dead retreat link and a dead chapter link shouldn't get two different pages. Rendered inside PageShell so the chrome doesn't flicker in and out between loading and loaded. A 404 gets no retry button: the slug doesn't exist and trying again won't change that. Anything else does, because a dropped connection is the usual cause and one tap fixes it. ═══════════════════════════════════════════════════════════════ */ import { Link } from 'react-router-dom' import PageShell from './PageShell.tsx' const TEAL = '#138ba0' const BODY = '#4a6b72' export default function PageState({ loading, error, notFound, onRetry, noun, backTo, backLabel, }: { loading: boolean error: string | null notFound: boolean onRetry: () => void /** Lowercase, as it appears mid-sentence: "retreat", "chapter". */ noun: string backTo: string backLabel: string }) { let title: string let content: React.ReactNode if (notFound) { title = 'Not found' content = (
There’s no {noun} at this address. It may have been renamed, or taken down.
{backLabel}Couldn’t load this {noun}. {error}
Loading this {noun}…
) } return (