SurfSense/surfsense_web/app/dashboard/[search_space_id]/layout.tsx

60 lines
1.1 KiB
TypeScript
Raw Normal View History

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
2026-01-01 22:24:42 +05:30
const customNavMain = [
{
title: "Chat",
url: `/dashboard/${search_space_id}/new-chat`,
icon: "MessageCircle",
items: [],
},
{
title: "Documents",
url: `/dashboard/${search_space_id}/documents`,
icon: "SquareLibrary",
items: [],
},
2025-07-27 10:05:37 -07:00
{
title: "Logs",
url: `/dashboard/${search_space_id}/logs`,
icon: "Logs",
2025-07-27 10:05:37 -07:00
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>
);
}