diff --git a/src/interface/web/app/components/appSidebar/appSidebar.tsx b/src/interface/web/app/components/appSidebar/appSidebar.tsx index 2f5f9bf8..b660ee52 100644 --- a/src/interface/web/app/components/appSidebar/appSidebar.tsx +++ b/src/interface/web/app/components/appSidebar/appSidebar.tsx @@ -17,7 +17,7 @@ import { KhojSearchLogo, } from "../logo/khojLogo"; import { Gear } from "@phosphor-icons/react/dist/ssr"; -import { Book, Plus } from "@phosphor-icons/react"; +import { Plus } from "@phosphor-icons/react"; import { useEffect, useState } from "react"; import AllConversations from "../allConversations/allConversations"; import FooterMenu from "../navMenu/navMenu"; @@ -55,11 +55,6 @@ const items = [ url: "/settings", icon: Gear, }, - { - title: "Knowledge Base", - url: "/knowledge", - icon: Book, - }, ]; const SIDEBAR_KEYBOARD_SHORTCUT = "b"; diff --git a/src/interface/web/app/knowledge/page.tsx b/src/interface/web/app/knowledge/page.tsx deleted file mode 100644 index cf040156..00000000 --- a/src/interface/web/app/knowledge/page.tsx +++ /dev/null @@ -1,93 +0,0 @@ -"use client"; - -import { useState, useEffect } from "react"; -import { SidebarInset, SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; -import { AppSidebar } from "../components/appSidebar/appSidebar"; -import { Separator } from "@/components/ui/separator"; -import { KhojLogoType } from "../components/logo/khojLogo"; -import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"; -import { useIsMobileWidth } from "../common/utils"; -import { InlineLoading } from "../components/loading/loading"; - -interface FileObject { - file_name: string; - raw_text: string; -} - -export default function KnowledgeBase() { - const [files, setFiles] = useState([]); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - const isMobileWidth = useIsMobileWidth(); - - useEffect(() => { - const fetchFiles = async () => { - try { - const response = await fetch("/api/content/all"); - if (!response.ok) throw new Error("Failed to fetch files"); - - const filesList = await response.json(); - if (Array.isArray(filesList)) { - setFiles(filesList.toSorted()); - } - } catch (error) { - setError("Failed to load files"); - console.error("Error fetching files:", error); - } finally { - setLoading(false); - } - }; - - fetchFiles(); - }, []); - - return ( - - - -
- - - {isMobileWidth ? ( - - - - ) : ( -

Knowledge Base

- )} -
-
-
- {loading && ( -
- -
- )} - {error &&
{error}
} - -
- {files.map((file, index) => ( - - - - {file.file_name.split("/").pop()} - - - -

- {file.raw_text.slice(0, 100)}... -

-
-
- ))} -
-
-
-
-
- ); -} diff --git a/src/interface/web/app/search/page.tsx b/src/interface/web/app/search/page.tsx index 2f9e99f1..2d1dd6c5 100644 --- a/src/interface/web/app/search/page.tsx +++ b/src/interface/web/app/search/page.tsx @@ -276,7 +276,7 @@ const UploadFiles: React.FC<{ return ( - +