mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
refactor(problems): restructure bot parallel routing
This commit is contained in:
parent
0d074a556d
commit
6c34fa0171
15
src/app/(app)/problems/[id]/@Bot/layout.tsx
Normal file
15
src/app/(app)/problems/[id]/@Bot/layout.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
interface BotLayoutProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function BotLayout({
|
||||
children,
|
||||
}: BotLayoutProps) {
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
<div className="relative flex-1 border-x border-muted">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -46,7 +46,7 @@ export default function AiBotPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="h-full flex flex-col">
|
||||
<div className="flex flex-col h-full bg-background">
|
||||
<div className="flex-1 relative">
|
||||
{!messages.some((message) => message.role === "user" || message.role === "assistant") && (
|
||||
<div className="absolute bottom-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-muted-foreground flex flex-col items-center gap-2">
|
@ -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 (
|
||||
<Suspense fallback={<Loading />}>
|
||||
{children}
|
||||
</Suspense>
|
||||
);
|
||||
}
|
@ -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 (
|
||||
<Tabs defaultValue="bot" className="h-full flex flex-col">
|
||||
<ScrollArea className="h-9 flex-none bg-muted">
|
||||
<TabsList>
|
||||
<TabsTrigger value="bot">
|
||||
<BotIcon
|
||||
className="-ms-0.5 me-1.5 opacity-60"
|
||||
size={16}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
Bot
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
<ScrollBar orientation="horizontal" />
|
||||
</ScrollArea>
|
||||
<TabsContent value="bot" className="h-full mt-0">
|
||||
{bot}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user