repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
The Living OS cockpit
stars
latest
clone command
git clone gitlawb://did:key:z6Mku78K...XywC/living-os-cockp...git clone gitlawb://did:key:z6Mku78K.../living-os-cockp...59751530feat: surface worker supervisor health in live work5h ago| #1 | 'use client'; |
| #2 | |
| #3 | import { Component, ReactNode } from 'react'; |
| #4 | |
| #5 | type Props = { children: ReactNode }; |
| #6 | type State = { error: Error | null }; |
| #7 | |
| #8 | export default class CockpitErrorBoundary extends Component<Props, State> { |
| #9 | state: State = { error: null }; |
| #10 | |
| #11 | static getDerivedStateFromError(error: Error): State { |
| #12 | return { error }; |
| #13 | } |
| #14 | |
| #15 | componentDidCatch(error: Error) { |
| #16 | console.error('Cockpit render boundary caught an error', error); |
| #17 | } |
| #18 | |
| #19 | render() { |
| #20 | if (!this.state.error) return this.props.children; |
| #21 | return ( |
| #22 | <main className="min-h-screen px-4 md:px-8 py-6 max-w-[1100px] mx-auto"> |
| #23 | <section className="card p-5"> |
| #24 | <h1 className="card-header text-lg mb-2">The Living.OS needs a clean reload</h1> |
| #25 | <p className="text-sm text-[color:var(--text-2)] leading-6"> |
| #26 | A cockpit panel returned data the browser could not render. Your session is still protected; reload once, and if it repeats, sign in again so the OS can refresh your member context. |
| #27 | </p> |
| #28 | <pre className="mt-4 max-h-36 overflow-auto rounded border border-[color:var(--border)] bg-black/30 p-3 text-xs text-[color:var(--text-3)]"> |
| #29 | {this.state.error.message} |
| #30 | </pre> |
| #31 | <button onClick={() => window.location.reload()} className="btn-gold mt-4 rounded px-4 py-2 text-sm">Reload</button> |
| #32 | </section> |
| #33 | </main> |
| #34 | ); |
| #35 | } |
| #36 | } |
| #37 |