Prettier format pending files
This commit is contained in:
parent
cd32b1bfd3
commit
25a7d8cd39
3 changed files with 28 additions and 18 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component, ErrorInfo, ReactNode } from 'react';
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { AlertTriangle, RefreshCw } from 'lucide-react';
|
||||
import React, { Component, ErrorInfo, ReactNode } from "react";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { AlertTriangle, RefreshCw } from "lucide-react";
|
||||
|
||||
interface Props {
|
||||
children: ReactNode;
|
||||
|
|
@ -15,7 +15,7 @@ interface State {
|
|||
|
||||
class ErrorBoundary extends Component<Props, State> {
|
||||
public state: State = {
|
||||
hasError: false
|
||||
hasError: false,
|
||||
};
|
||||
|
||||
public static getDerivedStateFromError(error: Error): State {
|
||||
|
|
@ -23,7 +23,7 @@ class ErrorBoundary extends Component<Props, State> {
|
|||
}
|
||||
|
||||
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
console.error('Uncaught error:', error, errorInfo);
|
||||
console.error("Uncaught error:", error, errorInfo);
|
||||
this.setState({ error, errorInfo });
|
||||
}
|
||||
|
||||
|
|
@ -46,11 +46,14 @@ class ErrorBoundary extends Component<Props, State> {
|
|||
<div className="space-y-2">
|
||||
<h3 className="font-semibold">Something went wrong</h3>
|
||||
<p className="text-sm">
|
||||
An error occurred while rendering the application. This is usually temporary.
|
||||
An error occurred while rendering the application. This is
|
||||
usually temporary.
|
||||
</p>
|
||||
{this.state.error && (
|
||||
<details className="text-xs opacity-70">
|
||||
<summary className="cursor-pointer">Error details</summary>
|
||||
<summary className="cursor-pointer">
|
||||
Error details
|
||||
</summary>
|
||||
<pre className="mt-2 whitespace-pre-wrap break-words">
|
||||
{this.state.error.message}
|
||||
</pre>
|
||||
|
|
@ -59,9 +62,13 @@ class ErrorBoundary extends Component<Props, State> {
|
|||
</div>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={this.handleReset} variant="outline" className="flex-1">
|
||||
<Button
|
||||
onClick={this.handleReset}
|
||||
variant="outline"
|
||||
className="flex-1"
|
||||
>
|
||||
Try Again
|
||||
</Button>
|
||||
<Button onClick={this.handleReload} className="flex-1">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import App from './App';
|
||||
import ErrorBoundary from './components/ErrorBoundary';
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App";
|
||||
import ErrorBoundary from "./components/ErrorBoundary";
|
||||
|
||||
const container = document.getElementById('root');
|
||||
const container = document.getElementById("root");
|
||||
if (!container) {
|
||||
throw new Error('Root element not found');
|
||||
throw new Error("Root element not found");
|
||||
}
|
||||
|
||||
const root = createRoot(container);
|
||||
|
|
@ -14,5 +14,5 @@ root.render(
|
|||
<ErrorBoundary>
|
||||
<App />
|
||||
</ErrorBoundary>
|
||||
</StrictMode>
|
||||
</StrictMode>,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>AeThex - Advanced Development Platform</title>
|
||||
<meta name="description" content="AeThex community platform for developers, projects, and innovation" />
|
||||
<meta
|
||||
name="description"
|
||||
content="AeThex community platform for developers, projects, and innovation"
|
||||
/>
|
||||
<link rel="icon" type="image/svg+xml" href="/placeholder.svg" />
|
||||
</head>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue