Initial commit

This commit is contained in:
Zdeněk Burda
2026-01-09 21:26:40 +01:00
parent e83aec6dca
commit 41e3ce6f25
404 changed files with 61250 additions and 28 deletions

View File

@@ -0,0 +1,35 @@
import React from "react";
type AppErrorBoundaryProps = {
children: React.ReactNode;
};
type AppErrorBoundaryState = {
hasError: boolean;
};
export default class AppErrorBoundary extends React.Component<AppErrorBoundaryProps, AppErrorBoundaryState> {
state: AppErrorBoundaryState = {
hasError: false,
};
static getDerivedStateFromError() {
return { hasError: true };
}
componentDidCatch(error: unknown, info: React.ErrorInfo) {
console.error("AppErrorBoundary caught an error", error, info);
}
render() {
if (this.state.hasError) {
return (
<div className="p-4 text-sm text-red-600">
Došlo k chybě při vykreslování stránky.
</div>
);
}
return this.props.children;
}
}