Skip to content

Commit 9a698bb

Browse files
authored
feat(dashboard): extract SessionActions component and convert learning space tabs to path-based routes (#530)
- Extract shared SessionActions component (Messages, Tasks, Config, Delete) for both Dashboard and Dashboard OSS, replacing inline action buttons - Convert learning space detail tabs from query params (?tab=) to path-based routes (/skills, /sessions, /metadata) using layout + sub-routes pattern - Use React Context in layout client to share data across tab routes - Use Tabs/TabsList/TabsTrigger components for consistent tab styling
1 parent 4d3e807 commit 9a698bb

20 files changed

Lines changed: 1597 additions & 1290 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { redirect } from "next/navigation";
2+
import { LearningSpaceLayoutClient } from "./learning-space-layout-client";
3+
import {
4+
getCurrentUser,
5+
getProject,
6+
} from "@/lib/supabase/operations";
7+
import { decodeId } from "@/lib/id-codec";
8+
9+
interface LayoutProps {
10+
params: Promise<{ id: string; spaceId: string }>;
11+
children: React.ReactNode;
12+
}
13+
14+
export default async function LearningSpaceLayout({
15+
params,
16+
children,
17+
}: LayoutProps) {
18+
const { id: projectId, spaceId } = await params;
19+
const actualProjectId = decodeId(projectId);
20+
const actualSpaceId = decodeId(spaceId);
21+
22+
await getCurrentUser();
23+
24+
const project = await getProject(actualProjectId);
25+
26+
if (!project) {
27+
redirect("/");
28+
}
29+
30+
return (
31+
<LearningSpaceLayoutClient
32+
project={{
33+
id: project.project_id,
34+
name: project.name,
35+
organization_id: project.organization_id,
36+
created_at: project.created_at,
37+
}}
38+
spaceId={actualSpaceId}
39+
>
40+
{children}
41+
</LearningSpaceLayoutClient>
42+
);
43+
}

0 commit comments

Comments
 (0)