Refactor frontend routing and component structure for improved navigation
- Update CLAUDE.md to reflect changes in the navigation model, emphasizing the use of App Router routes for sidebar sections. - Refactor layout.tsx to wrap children in AppShell, enhancing the overall layout structure. - Replace AppShell usage in page.tsx with HomePage component for better separation of concerns. - Introduce new pages for assistants, components, dashboard, history, profile, and test, each rendering their respective components. - Revise Sidebar component to utilize Next.js Link for navigation and improve active state handling based on the current pathname. - Update AssistantPage to support routing-driven modes (list, choose, edit) and streamline form handling for assistant creation and editing.
This commit is contained in:
10
frontend/src/app/assistants/[id]/page.tsx
Normal file
10
frontend/src/app/assistants/[id]/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { AssistantPage } from "@/components/pages/AssistantPage";
|
||||
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
return <AssistantPage mode="edit" assistantId={id} />;
|
||||
}
|
||||
5
frontend/src/app/assistants/new/page.tsx
Normal file
5
frontend/src/app/assistants/new/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AssistantPage } from "@/components/pages/AssistantPage";
|
||||
|
||||
export default function Page() {
|
||||
return <AssistantPage mode="choose" />;
|
||||
}
|
||||
5
frontend/src/app/assistants/page.tsx
Normal file
5
frontend/src/app/assistants/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AssistantPage } from "@/components/pages/AssistantPage";
|
||||
|
||||
export default function Page() {
|
||||
return <AssistantPage mode="list" />;
|
||||
}
|
||||
5
frontend/src/app/components/knowledge/page.tsx
Normal file
5
frontend/src/app/components/knowledge/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ComponentsKnowledgePage } from "@/components/pages/ComponentsKnowledgePage";
|
||||
|
||||
export default function Page() {
|
||||
return <ComponentsKnowledgePage />;
|
||||
}
|
||||
5
frontend/src/app/components/models/page.tsx
Normal file
5
frontend/src/app/components/models/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ComponentsModelsPage } from "@/components/pages/ComponentsModelsPage";
|
||||
|
||||
export default function Page() {
|
||||
return <ComponentsModelsPage />;
|
||||
}
|
||||
5
frontend/src/app/components/tools/page.tsx
Normal file
5
frontend/src/app/components/tools/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ComponentsToolsPage } from "@/components/pages/ComponentsToolsPage";
|
||||
|
||||
export default function Page() {
|
||||
return <ComponentsToolsPage />;
|
||||
}
|
||||
5
frontend/src/app/dashboard/page.tsx
Normal file
5
frontend/src/app/dashboard/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { DashboardPage } from "@/components/pages/DashboardPage";
|
||||
|
||||
export default function Page() {
|
||||
return <DashboardPage />;
|
||||
}
|
||||
5
frontend/src/app/history/page.tsx
Normal file
5
frontend/src/app/history/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { HistoryPage } from "@/components/pages/HistoryPage";
|
||||
|
||||
export default function Page() {
|
||||
return <HistoryPage />;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
import { Geist_Mono, Inter, Cormorant_Garamond } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { AppShell } from "@/components/layout/AppShell";
|
||||
|
||||
const inter = Inter({ subsets: ["latin"], variable: "--font-sans" });
|
||||
|
||||
@@ -48,7 +49,9 @@ export default function RootLayout({
|
||||
<head>
|
||||
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
||||
</head>
|
||||
<body className="min-h-full flex flex-col">{children}</body>
|
||||
<body className="min-h-full flex flex-col">
|
||||
<AppShell>{children}</AppShell>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AppShell } from "@/components/layout/AppShell";
|
||||
import { HomePage } from "@/components/pages/HomePage";
|
||||
|
||||
export default function Home() {
|
||||
return <AppShell />;
|
||||
}
|
||||
return <HomePage />;
|
||||
}
|
||||
|
||||
5
frontend/src/app/profile/page.tsx
Normal file
5
frontend/src/app/profile/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ProfilePage } from "@/components/pages/ProfilePage";
|
||||
|
||||
export default function Page() {
|
||||
return <ProfilePage />;
|
||||
}
|
||||
5
frontend/src/app/test/page.tsx
Normal file
5
frontend/src/app/test/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TestPage } from "@/components/pages/TestPage";
|
||||
|
||||
export default function Page() {
|
||||
return <TestPage />;
|
||||
}
|
||||
Reference in New Issue
Block a user