mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 23:56:33 +00:00
refactor(playground/problem): restructure layout props and add route nesting
This commit is contained in:
parent
0ad1f24c7a
commit
ffe8c106d8
@ -1,6 +1,6 @@
|
|||||||
import MdxPreview from "@/components/mdx-preview";
|
import MdxPreview from "@/components/mdx-preview";
|
||||||
import { DEFAULT_PROBLEM } from "@/config/problem";
|
import { DEFAULT_PROBLEM } from "@/config/problem";
|
||||||
|
|
||||||
export default function DescriptionPage() {
|
export default function ProblemDescriptionPage() {
|
||||||
return <MdxPreview source={DEFAULT_PROBLEM} />;
|
return <MdxPreview source={DEFAULT_PROBLEM} />;
|
||||||
}
|
}
|
@ -3,10 +3,10 @@ import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
|
|||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
|
|
||||||
interface ProblemLayoutProps {
|
interface ProblemLayoutProps {
|
||||||
children: React.ReactNode;
|
description: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ProblemLayout({ children }: ProblemLayoutProps) {
|
export default function ProblemLayout({ description }: ProblemLayoutProps) {
|
||||||
return (
|
return (
|
||||||
<Tabs defaultValue="description" className="h-full flex flex-col">
|
<Tabs defaultValue="description" className="h-full flex flex-col">
|
||||||
<ScrollArea className="h-9 flex-none bg-muted px-1">
|
<ScrollArea className="h-9 flex-none bg-muted px-1">
|
||||||
@ -26,7 +26,7 @@ export default function ProblemLayout({ children }: ProblemLayoutProps) {
|
|||||||
<ScrollBar orientation="horizontal" />
|
<ScrollBar orientation="horizontal" />
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
<TabsContent value="description" className="grow mt-0">
|
<TabsContent value="description" className="grow mt-0">
|
||||||
{children}
|
{description}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user