mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-11 14:10:15 -07:00
23a3185696
Cleaned up the code a bit (thx gpt4), with: - dynamic module load: JS is chunked up and deferred to PDF loading, which improves all the sessions where PDFs are not loaded - unified path for drag/drop and 'load file' (shall call it "magic drop" so PDFs are text'ified upon drag/dop as well - fixed "not being able to load the same doc twice" (thx gpt4) - using minified worker, as it's loaded dynamically, we save ~50% bandwidth
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import * as React from 'react';
|
|
import Head from 'next/head';
|
|
import { Analytics as VercelAnalytics } from '@vercel/analytics/react';
|
|
import { AppProps } from 'next/app';
|
|
import { CacheProvider, EmotionCache } from '@emotion/react';
|
|
import { CssBaseline, CssVarsProvider } from '@mui/joy';
|
|
|
|
import { createEmotionCache, theme } from '@/lib/theme';
|
|
|
|
|
|
// Client-side cache, shared for the whole session of the user in the browser.
|
|
const clientSideEmotionCache = createEmotionCache();
|
|
|
|
export interface MyAppProps extends AppProps {
|
|
emotionCache?: EmotionCache;
|
|
}
|
|
|
|
export default function MyApp({ Component, emotionCache = clientSideEmotionCache, pageProps }: MyAppProps) {
|
|
return <>
|
|
<CacheProvider value={emotionCache}>
|
|
<Head>
|
|
<meta name='viewport' content='initial-scale=1, width=device-width' />
|
|
</Head>
|
|
<CssVarsProvider defaultMode='light' theme={theme}>
|
|
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
|
|
<CssBaseline />
|
|
<Component {...pageProps} />
|
|
</CssVarsProvider>
|
|
</CacheProvider>
|
|
<VercelAnalytics debug={false} />
|
|
</>;
|
|
} |