/
home
/
techb158
/
balavpn.abdallabala.com
/
src
/
components
/
/home/techb158/balavpn.abdallabala.com/src/components
mkdir
upload
Name
Size
Mode
Actions
AppShell.jsx
3376
0644
edit
dl
rm
ErrorBoundary.jsx
951
0644
edit
dl
rm
LogoutButton.jsx
395
0644
edit
dl
rm
Edit:
/home/techb158/balavpn.abdallabala.com/src/components/ErrorBoundary.jsx
(951B)
'use client'; import { Component } from 'react'; export default class ErrorBoundary extends Component { constructor(props) { super(props); this.state = { error: null }; } static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return ( <div className="empty-state"> <div className="empty-icon">!</div> <p>Something went wrong in {this.props.name || 'this section'}.</p> <p className="muted" style={{ fontSize: 12, marginTop: 4 }}>{this.state.error.message}</p> <button className="button secondary small" style={{ marginTop: 12 }} onClick={() => { this.setState({ error: null }); this.props.onRetry?.(); }}>Retry</button> </div> ); } return this.props.children; } }
Save
cmd:
run