2025-04-07 23:47:06 -07:00
|
|
|
// Server component
|
2025-07-27 10:05:37 -07:00
|
|
|
import type React from "react";
|
|
|
|
|
import { use } from "react";
|
|
|
|
|
import { DashboardClientLayout } from "./client-layout";
|
2025-04-07 23:47:06 -07:00
|
|
|
|
2025-07-27 10:05:37 -07:00
|
|
|
export default function DashboardLayout({
|
|
|
|
|
params,
|
|
|
|
|
children,
|
|
|
|
|
}: {
|
|
|
|
|
params: Promise<{ search_space_id: string }>;
|
|
|
|
|
children: React.ReactNode;
|
2025-04-07 23:47:06 -07:00
|
|
|
}) {
|
2025-07-27 10:05:37 -07:00
|
|
|
// Use React.use to unwrap the params Promise
|
|
|
|
|
const { search_space_id } = use(params);
|
2025-04-07 23:47:06 -07:00
|
|
|
|
2025-07-27 10:05:37 -07:00
|
|
|
const customNavSecondary = [
|
|
|
|
|
{
|
|
|
|
|
title: `All Search Spaces`,
|
|
|
|
|
url: `#`,
|
|
|
|
|
icon: "Info",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: `All Search Spaces`,
|
|
|
|
|
url: "/dashboard",
|
|
|
|
|
icon: "Undo2",
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-04-07 23:47:06 -07:00
|
|
|
|
2025-07-27 10:05:37 -07:00
|
|
|
const customNavMain = [
|
|
|
|
|
{
|
2025-11-16 15:54:54 -08:00
|
|
|
title: "Chat",
|
2025-07-27 10:05:37 -07:00
|
|
|
url: `/dashboard/${search_space_id}/researcher`,
|
|
|
|
|
icon: "SquareTerminal",
|
|
|
|
|
items: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-11-07 14:28:30 -08:00
|
|
|
title: "Sources",
|
2025-07-27 10:05:37 -07:00
|
|
|
url: "#",
|
2025-11-07 14:28:30 -08:00
|
|
|
icon: "Database",
|
2025-07-27 10:05:37 -07:00
|
|
|
items: [
|
|
|
|
|
{
|
2025-11-07 14:28:30 -08:00
|
|
|
title: "Add Sources",
|
|
|
|
|
url: `/dashboard/${search_space_id}/sources/add`,
|
2025-07-27 10:05:37 -07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Manage Documents",
|
|
|
|
|
url: `/dashboard/${search_space_id}/documents`,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Manage Connectors",
|
|
|
|
|
url: `/dashboard/${search_space_id}/connectors`,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-11-27 22:45:04 -08:00
|
|
|
{
|
|
|
|
|
title: "Team",
|
|
|
|
|
url: `/dashboard/${search_space_id}/team`,
|
|
|
|
|
icon: "Users",
|
|
|
|
|
items: [],
|
|
|
|
|
},
|
2025-11-19 15:04:46 -08:00
|
|
|
{
|
|
|
|
|
title: "Settings",
|
|
|
|
|
url: `/dashboard/${search_space_id}/settings`,
|
|
|
|
|
icon: "Settings2",
|
|
|
|
|
items: [],
|
|
|
|
|
},
|
2025-07-27 10:05:37 -07:00
|
|
|
{
|
|
|
|
|
title: "Logs",
|
|
|
|
|
url: `/dashboard/${search_space_id}/logs`,
|
|
|
|
|
icon: "FileText",
|
|
|
|
|
items: [],
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-04-07 23:47:06 -07:00
|
|
|
|
2025-07-27 10:05:37 -07:00
|
|
|
return (
|
|
|
|
|
<DashboardClientLayout
|
|
|
|
|
searchSpaceId={search_space_id}
|
|
|
|
|
navSecondary={customNavSecondary}
|
|
|
|
|
navMain={customNavMain}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</DashboardClientLayout>
|
|
|
|
|
);
|
|
|
|
|
}
|