)
})
-ChatPanel.displayName = 'ChatPanel'
+ChatPanel.displayName = 'ChatPanel'
\ No newline at end of file
diff --git a/components/error-boundary.tsx b/components/error-boundary.tsx
new file mode 100644
index 00000000..c89beed8
--- /dev/null
+++ b/components/error-boundary.tsx
@@ -0,0 +1,51 @@
+'use client';
+
+import React, { Component, ErrorInfo, ReactNode } from 'react';
+
+interface Props {
+ children: ReactNode;
+}
+
+interface State {
+ hasError: boolean;
+}
+
+class ErrorBoundary extends Component {
+ public state: State = {
+ hasError: false,
+ };
+
+ public static getDerivedStateFromError(_: Error): State {
+ // Update state so the next render will show the fallback UI.
+ return { hasError: true };
+ }
+
+ public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
+ // In a real application, you would log this to an error reporting service.
+ console.error("ErrorBoundary caught an error:", error, errorInfo);
+ }
+
+ public render() {
+ if (this.state.hasError) {
+ // You can render any custom fallback UI.
+ return (
+
+
Something went wrong.
+
+ An unexpected error occurred. We've logged the issue and will look into it.
+
+
+
+ );
+ }
+
+ return this.props.children;
+ }
+}
+
+export default ErrorBoundary;
\ No newline at end of file
diff --git a/components/settings/components/model-selection-form.tsx b/components/settings/components/model-selection-form.tsx
index 81db97c4..ac7dfa00 100644
--- a/components/settings/components/model-selection-form.tsx
+++ b/components/settings/components/model-selection-form.tsx
@@ -13,6 +13,9 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { Card, CardContent } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Sparkles, Zap, Rocket, Cpu, Earth } from "lucide-react";
+import { Switch } from "@/components/ui/switch";
+import { Label } from "@/components/ui/label";
+import { useGeospatialModel } from "@/lib/geospatial-model-context";
interface ModelSelectionFormProps {
form: UseFormReturn;
@@ -54,6 +57,8 @@ const models = [
];
export function ModelSelectionForm({ form }: ModelSelectionFormProps) {
+ const { isGeospatialModelEnabled, toggleGeospatialModel } = useGeospatialModel();
+
return (
-
-
{model.name}
-
- {model.badge}
-
+
+
+
{model.name}
+
+ {model.badge}
+
+
+ {model.id === "QCX-Terra" && (
+
+
+
+
+ )}
{model.description}
diff --git a/dev.log b/dev.log
deleted file mode 100644
index d83bb75f..00000000
--- a/dev.log
+++ /dev/null
@@ -1,7 +0,0 @@
- ⚠ Port 3000 is in use, using available port 3001 instead.
- ▲ Next.js 15.3.3 (Turbopack)
- - Local: http://localhost:3001
- - Network: http://192.168.0.2:3001
- - Environments: .env.local, .env
-
- ✓ Starting...
diff --git a/lib/geospatial-model-context.tsx b/lib/geospatial-model-context.tsx
new file mode 100644
index 00000000..d076382b
--- /dev/null
+++ b/lib/geospatial-model-context.tsx
@@ -0,0 +1,36 @@
+'use client';
+
+import React, { createContext, useState, useContext, ReactNode } from 'react';
+
+// Define the shape of the context
+interface GeospatialModelContextType {
+ isGeospatialModelEnabled: boolean;
+ toggleGeospatialModel: () => void;
+}
+
+// Create the context with a default value
+const GeospatialModelContext = createContext(undefined);
+
+// Create the provider component
+export const GeospatialModelProvider = ({ children }: { children: ReactNode }) => {
+ const [isGeospatialModelEnabled, setIsGeospatialModelEnabled] = useState(false);
+
+ const toggleGeospatialModel = () => {
+ setIsGeospatialModelEnabled(prevState => !prevState);
+ };
+
+ return (
+
+ {children}
+
+ );
+};
+
+// Create a custom hook for easy access to the context
+export const useGeospatialModel = () => {
+ const context = useContext(GeospatialModelContext);
+ if (context === undefined) {
+ throw new Error('useGeospatialModel must be used within a GeospatialModelProvider');
+ }
+ return context;
+};
\ No newline at end of file