fix(agents): Wrap NewAgentPage in Suspense for useSearchParams
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, Suspense } from 'react';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import { Bot, ChevronLeft, Save, Loader2 } from 'lucide-react';
|
||||
@@ -38,7 +38,7 @@ const NODES = [
|
||||
{ id: 'node-2-macbook-m4max', name: 'NODE2 (MacBook Development)' },
|
||||
];
|
||||
|
||||
export default function NewAgentPage() {
|
||||
function NewAgentForm() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const prefilledMicrodao = searchParams.get('microdao');
|
||||
@@ -364,3 +364,15 @@ export default function NewAgentPage() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function NewAgentPage() {
|
||||
return (
|
||||
<Suspense fallback={
|
||||
<div className="min-h-screen bg-gradient-to-b from-slate-900 via-slate-900 to-slate-950 flex items-center justify-center">
|
||||
<Loader2 className="w-8 h-8 text-violet-400 animate-spin" />
|
||||
</div>
|
||||
}>
|
||||
<NewAgentForm />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user