feat: add error boundary and loading spinner components with SWR integration

This commit is contained in:
Developer
2026-03-18 16:18:19 +08:00
parent 1f51c330dd
commit 5dd00c310f
4 changed files with 137 additions and 6 deletions
+13 -6
View File
@@ -1,13 +1,20 @@
import '../styles/globals.css';
import { SWRConfig } from 'swr';
import ErrorBoundary from '../components/ErrorBoundary';
import { ToastProvider } from '../components/ToastProvider';
import { ConfirmProvider } from '../components/ConfirmProvider';
import { swrConfig } from '../lib/swr-config';
import '../styles/globals.css';
export default function App({ Component, pageProps }) {
return (
<ConfirmProvider>
<ToastProvider>
<Component {...pageProps} />
</ToastProvider>
</ConfirmProvider>
<ErrorBoundary>
<SWRConfig value={swrConfig}>
<ConfirmProvider>
<ToastProvider>
<Component {...pageProps} />
</ToastProvider>
</ConfirmProvider>
</SWRConfig>
</ErrorBoundary>
);
}