diff --git a/app/components/git/GitUrlImport.client.tsx b/app/components/git/GitUrlImport.client.tsx
index cbdeaa5..c2c949e 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 0000000..6c69798
--- /dev/null
+++ b/app/components/ui/LoadingOverlay.tsx
@@ -0,0 +1,14 @@
+export const LoadingOverlay = ({ message = 'Loading...' }) => {
+ return (
+
+ {/* Loading content */}
+
+
+ );
+};
diff --git a/app/components/ui/Settings.tsx b/app/components/ui/Settings.tsx
index 109163d..58295eb 100644
--- a/app/components/ui/Settings.tsx
+++ b/app/components/ui/Settings.tsx
@@ -10,7 +10,6 @@ import { toast } from 'react-toastify';
import { useNavigate } from '@remix-run/react';
import commit from '~/commit.json';
import Cookies from 'js-cookie';
-import { SettingsSlider } from './SettingsSlider';
import '~/styles/components/SettingsSlider.scss';
import '~/styles/components/Settings.scss';
@@ -219,9 +218,7 @@ export const Settings = ({ open, onClose }: SettingsProps) => {