diff --git a/surfsense_web/components/search-space-form.tsx b/surfsense_web/components/search-space-form.tsx index d4eedba..d03cab3 100644 --- a/surfsense_web/components/search-space-form.tsx +++ b/surfsense_web/components/search-space-form.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { motion } from "framer-motion"; import { cn } from "@/lib/utils"; -import { Plus, Search, Trash2 } from "lucide-react"; +import { MoveLeftIcon, Plus, Search, Trash2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; @@ -33,6 +33,7 @@ import { FormLabel, FormMessage, } from "@/components/ui/form"; +import { useRouter } from "next/navigation"; // Define the form schema with Zod const searchSpaceFormSchema = z.object({ @@ -59,7 +60,8 @@ export function SearchSpaceForm({ initialData = { name: "", description: "" } }: SearchSpaceFormProps) { const [showDeleteDialog, setShowDeleteDialog] = useState(false); - + const router = useRouter(); + // Initialize the form with React Hook Form and Zod validation const form = useForm({ resolver: zodResolver(searchSpaceFormSchema), @@ -115,17 +117,32 @@ export function SearchSpaceForm({ animate="visible" variants={containerVariants} > - -

- {isEditing ? "Edit Search Space" : "Create Search Space"} -

-

- {isEditing - ? "Update your search space details" - : "Create a new search space to organize your documents, chats, and podcasts."} -

+ +
+

+ {isEditing ? "Edit Search Space" : "Create Search Space"} +

+

+ {isEditing + ? "Update your search space details" + : "Create a new search space to organize your documents, chats, and podcasts."} +

+
+ +
- + - + - +
)} /> - + )} /> - +