From 6c34fa01716cb96f563c6fe912f2a5f3ceff9fd7 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Sat, 5 Apr 2025 16:21:35 +0800 Subject: [PATCH] refactor(problems): restructure bot parallel routing --- src/app/(app)/problems/[id]/@Bot/layout.tsx | 15 +++++++++ .../problems/[id]/{@ai/@bot => @Bot}/page.tsx | 2 +- .../(app)/problems/[id]/@ai/@bot/layout.tsx | 16 ---------- src/app/(app)/problems/[id]/@ai/layout.tsx | 32 ------------------- 4 files changed, 16 insertions(+), 49 deletions(-) create mode 100644 src/app/(app)/problems/[id]/@Bot/layout.tsx rename src/app/(app)/problems/[id]/{@ai/@bot => @Bot}/page.tsx (98%) delete mode 100644 src/app/(app)/problems/[id]/@ai/@bot/layout.tsx delete mode 100644 src/app/(app)/problems/[id]/@ai/layout.tsx diff --git a/src/app/(app)/problems/[id]/@Bot/layout.tsx b/src/app/(app)/problems/[id]/@Bot/layout.tsx new file mode 100644 index 0000000..675be62 --- /dev/null +++ b/src/app/(app)/problems/[id]/@Bot/layout.tsx @@ -0,0 +1,15 @@ +interface BotLayoutProps { + children: React.ReactNode; +} + +export default function BotLayout({ + children, +}: BotLayoutProps) { + return ( +
+
+ {children} +
+
+ ); +} diff --git a/src/app/(app)/problems/[id]/@ai/@bot/page.tsx b/src/app/(app)/problems/[id]/@Bot/page.tsx similarity index 98% rename from src/app/(app)/problems/[id]/@ai/@bot/page.tsx rename to src/app/(app)/problems/[id]/@Bot/page.tsx index 7e10d13..6f40c81 100644 --- a/src/app/(app)/problems/[id]/@ai/@bot/page.tsx +++ b/src/app/(app)/problems/[id]/@Bot/page.tsx @@ -46,7 +46,7 @@ export default function AiBotPage() { ); return ( -
+
{!messages.some((message) => message.role === "user" || message.role === "assistant") && (
diff --git a/src/app/(app)/problems/[id]/@ai/@bot/layout.tsx b/src/app/(app)/problems/[id]/@ai/@bot/layout.tsx deleted file mode 100644 index 8185d75..0000000 --- a/src/app/(app)/problems/[id]/@ai/@bot/layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { Suspense } from "react"; -import { Loading } from "@/components/loading"; - -interface AiBotLayoutProps { - children: React.ReactNode; -} - -export default function AiBotLayout({ - children, -}: AiBotLayoutProps) { - return ( - }> - {children} - - ); -} diff --git a/src/app/(app)/problems/[id]/@ai/layout.tsx b/src/app/(app)/problems/[id]/@ai/layout.tsx deleted file mode 100644 index 9f787f4..0000000 --- a/src/app/(app)/problems/[id]/@ai/layout.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { BotIcon } from "lucide-react"; -import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; - -interface AiLayoutProps { - bot: React.ReactNode; -} - -export default function AiLayout({ - bot, -}: AiLayoutProps) { - return ( - - - - - - - - - - {bot} - - - ); -}