File size: 791 Bytes
2471af3
 
 
 
0953253
2471af3
61db3dc
2471af3
 
 
 
 
 
 
 
0953253
2471af3
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Component, StrictMode, type ReactNode } from "react"
import { createRoot } from "react-dom/client"
import "./index.css"
import App from "./App.tsx"
import { T } from "@/lib/i18n"

// Light only, as minimax.io is; the galaxy carries its own .dark stage.

// If the page and its data file ever disagree, say so instead of showing a blank page.
class Fallback extends Component<{ children: ReactNode }, { failed: boolean }> {
  state = { failed: false }
  static getDerivedStateFromError() {
    return { failed: true }
  }
  render() {
    return this.state.failed ? <p style={{ padding: 40, fontSize: 18 }}>{T.broken}</p> : this.props.children
  }
}

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <Fallback>
      <App />
    </Fallback>
  </StrictMode>,
)