Spaces:
Paused
Paused
Download src/main.jsx from InvertedShu/osint-sm-tools: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/InvertedShu/osint-sm-tools/resolve/main/src/main.jsx
- Command line
-
hf download hf://spaces/InvertedShu/osint-sm-tools/src/main.jsx
-
curl -L -o main.jsx https://huggingface.co/spaces/InvertedShu/osint-sm-tools/resolve/main/src/main.jsx
1.14 kB
| import './polyfills' | |
| import React, { Component, StrictMode } from 'react' | |
| import { createRoot } from 'react-dom/client' | |
| import './index.css' | |
| import App from './App.jsx' | |
| class ErrorBoundary extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { hasError: false, error: null }; | |
| } | |
| static getDerivedStateFromError(error) { | |
| return { hasError: true, error }; | |
| } | |
| componentDidCatch(error, errorInfo) { | |
| console.error("ErrorBoundary caught an error", error, errorInfo); | |
| } | |
| render() { | |
| if (this.state.hasError) { | |
| return ( | |
| <div className="p-20 text-red-500 bg-slate-100 min-h-screen"> | |
| <h1 className="text-2xl font-bold mb-4 text-red-600">Something went wrong.</h1> | |
| <pre className="whitespace-pre-wrap text-slate-900 bg-slate-200 p-4 rounded border border-red-300 overflow-auto"> | |
| {this.state.error.stack || this.state.error.message} | |
| </pre> | |
| </div> | |
| ); | |
| } | |
| return this.props.children; | |
| } | |
| } | |
| createRoot(document.getElementById('root')).render( | |
| <StrictMode> | |
| <ErrorBoundary> | |
| <App /> | |
| </ErrorBoundary> | |
| </StrictMode>, | |
| ) | |