diff --git a/web/src/app/admin/layout.tsx b/web/src/app/admin/layout.tsx
index 4e1ba7722..026139fe6 100644
--- a/web/src/app/admin/layout.tsx
+++ b/web/src/app/admin/layout.tsx
@@ -1,292 +1,9 @@
-import { Header } from "@/components/Header";
-import { Sidebar } from "@/components/admin/connectors/Sidebar";
-import {
- NotebookIcon,
- GithubIcon,
- GlobeIcon,
- GoogleDriveIcon,
- SlackIcon,
- KeyIcon,
- BookstackIcon,
- ConfluenceIcon,
- GuruIcon,
- GongIcon,
- FileIcon,
- JiraIcon,
- SlabIcon,
- NotionIcon,
- ZulipIcon,
- ProductboardIcon,
- LinearIcon,
- UsersIcon,
- ThumbsUpIcon,
- HubSpotIcon,
- BookmarkIcon,
- CPUIcon,
-} from "@/components/icons/icons";
-import { getAuthDisabledSS, getCurrentUserSS } from "@/lib/userSS";
-import { redirect } from "next/navigation";
+import { Layout } from "@/components/admin/Layout";
export default async function AdminLayout({
children,
}: {
children: React.ReactNode;
}) {
- const [authDisabled, user] = await Promise.all([
- getAuthDisabledSS(),
- getCurrentUserSS(),
- ]);
-
- if (!authDisabled) {
- if (!user) {
- return redirect("/auth/login");
- }
- if (user.role !== "admin") {
- return redirect("/");
- }
- }
-
- return (
-
-
-
- ),
- link: "/admin/indexing/status",
- },
- ],
- },
- {
- name: "Connector Settings",
- items: [
- {
- name: (
-
- ),
- link: "/admin/connectors/slack",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/github",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/google-drive",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/confluence",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/jira",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/linear",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/productboard",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/slab",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/notion",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/guru",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/gong",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/bookstack",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/zulip",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/web",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/file",
- },
- {
- name: (
-
- ),
- link: "/admin/connectors/hubspot",
- },
- ],
- },
- {
- name: "Keys",
- items: [
- {
- name: (
-
- ),
- link: "/admin/keys/openai",
- },
- ],
- },
- {
- name: "User Management",
- items: [
- {
- name: (
-
- ),
- link: "/admin/users",
- },
- ],
- },
- {
- name: "Document Management",
- items: [
- {
- name: (
-
- ),
- link: "/admin/documents/sets",
- },
- {
- name: (
-
- ),
- link: "/admin/documents/feedback",
- },
- ],
- },
- {
- name: "Bots",
- items: [
- {
- name: (
-
- ),
- link: "/admin/bot",
- },
- ],
- },
- ]}
- />
-
- {children}
-
-
-
- );
+ return await Layout({ children });
}
diff --git a/web/src/components/Dropdown.tsx b/web/src/components/Dropdown.tsx
new file mode 100644
index 000000000..9903bcbf6
--- /dev/null
+++ b/web/src/components/Dropdown.tsx
@@ -0,0 +1,280 @@
+import { ChangeEvent, FC, useEffect, useRef, useState } from "react";
+import { ChevronDownIcon } from "./icons/icons";
+
+export interface Option {
+ name: string;
+ value: string;
+ description?: string;
+ metadata?: { [key: string]: any };
+}
+
+interface DropdownProps {
+ options: Option[];
+ selected: string;
+ onSelect: (selected: Option) => void;
+}
+
+export const Dropdown: FC