diff --git a/app/commit.json b/app/commit.json index f6de64509..6b30ae8bf 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "43e1f436f57fc4adb43b5481b403967803d4786d" , "version": "0.0.1" } +{ "commit": "43e1f436f57fc4adb43b5481b403967803d4786d" , "version": "0.0.1" } \ No newline at end of file diff --git a/app/components/git/GitUrlImport.client.tsx b/app/components/git/GitUrlImport.client.tsx index cbdeaa5cd..c2c949ec9 100644 --- a/app/components/git/GitUrlImport.client.tsx +++ b/app/components/git/GitUrlImport.client.tsx @@ -8,6 +8,8 @@ import { Chat } from '~/components/chat/Chat.client'; import { useGit } from '~/lib/hooks/useGit'; import { useChatHistory } from '~/lib/persistence'; import { createCommandsMessage, detectProjectCommands } from '~/utils/projectCommands'; +import { LoadingOverlay } from '~/components/ui/LoadingOverlay'; +import { toast } from 'react-toastify'; const IGNORE_PATTERNS = [ 'node_modules/**', @@ -38,6 +40,7 @@ export function GitUrlImport() { const { ready: historyReady, importChat } = useChatHistory(); const { ready: gitReady, gitClone } = useGit(); const [imported, setImported] = useState(false); + const [loading, setLoading] = useState(true); const importRepo = async (repoUrl?: string) => { if (!gitReady && !historyReady) { @@ -109,9 +112,23 @@ ${file.content} return; } - importRepo(url); + importRepo(url).catch((error) => { + console.error('Error importing repo:', error); + toast.error('Failed to import repository'); + setLoading(false); + window.location.href = '/'; + }); setImported(true); }, [searchParams, historyReady, gitReady, imported]); - return }>{() => }; + return ( + }> + {() => ( + <> + + {loading && } + + )} + + ); } diff --git a/app/components/ui/LoadingOverlay.tsx b/app/components/ui/LoadingOverlay.tsx new file mode 100644 index 000000000..6c69798f9 --- /dev/null +++ b/app/components/ui/LoadingOverlay.tsx @@ -0,0 +1,14 @@ +export const LoadingOverlay = ({ message = 'Loading...' }) => { + return ( +
+ {/* Loading content */} +
+
+

{message}

+
+
+ ); +}; diff --git a/app/routes/git.tsx b/app/routes/git.tsx index aa1689a44..5793e2218 100644 --- a/app/routes/git.tsx +++ b/app/routes/git.tsx @@ -4,6 +4,7 @@ import { ClientOnly } from 'remix-utils/client-only'; import { BaseChat } from '~/components/chat/BaseChat'; import { GitUrlImport } from '~/components/git/GitUrlImport.client'; import { Header } from '~/components/header/Header'; +import BackgroundRays from '~/components/ui/BackgroundRays'; export const meta: MetaFunction = () => { return [{ title: 'Bolt' }, { name: 'description', content: 'Talk with Bolt, an AI assistant from StackBlitz' }]; @@ -15,7 +16,8 @@ export async function loader(args: LoaderFunctionArgs) { export default function Index() { return ( -
+
+
}>{() => }