osint-sm-tools / src /main.jsx
InvertedShu
Initial Deployment Version: Parallel OSINT Dashboard
8a1c8a3
Raw History Blame Contribute Delete
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>,
)