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 (
    <ErrorBoundary>
      <SWRConfig value={swrConfig}>
        <ConfirmProvider>
          <ToastProvider>
            <Component {...pageProps} />
          </ToastProvider>
        </ConfirmProvider>
      </SWRConfig>
    </ErrorBoundary>
  );
}
