Initial commit: Sencho V1 complete with Auth and Dockerization

This commit is contained in:
unknown
2026-02-20 18:39:32 -05:00
commit 293f9cef26
51 changed files with 11547 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
import React, { Component } from 'react';
import type { ErrorInfo, ReactNode } from 'react';
interface Props {
children: ReactNode;
}
interface State {
hasError: boolean;
error: Error | null;
}
class ErrorBoundary extends Component<Props, State> {
public state: State = {
hasError: false,
error: null,
};
public static getDerivedStateFromError(error: Error): State {
return { hasError: true, error };
}
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
console.error('ErrorBoundary caught an error:', error, errorInfo);
}
public render() {
if (this.state.hasError) {
return (
<div className="p-6 bg-red-900/20 border border-red-500 rounded-xl m-4">
<h2 className="text-lg font-bold text-red-500 mb-2">Something went wrong</h2>
<p className="text-red-300 text-sm mb-4">{this.state.error?.message || 'Unknown error'}</p>
<button
className="px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600"
onClick={() => this.setState({ hasError: false, error: null })}
>
Try again
</button>
</div>
);
}
return this.props.children;
}
}
export default ErrorBoundary;