mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 15:26: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 { DEFAULT_PROBLEM } from "@/config/problem";
|
||||
|
||||
export default function DescriptionPage() {
|
||||
export default function ProblemDescriptionPage() {
|
||||
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";
|
||||
|
||||
interface ProblemLayoutProps {
|
||||
children: React.ReactNode;
|
||||
description: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function ProblemLayout({ children }: ProblemLayoutProps) {
|
||||
export default function ProblemLayout({ description }: ProblemLayoutProps) {
|
||||
return (
|
||||
<Tabs defaultValue="description" className="h-full flex flex-col">
|
||||
<ScrollArea className="h-9 flex-none bg-muted px-1">
|
||||
@ -26,7 +26,7 @@ export default function ProblemLayout({ children }: ProblemLayoutProps) {
|
||||
<ScrollBar orientation="horizontal" />
|
||||
</ScrollArea>
|
||||
<TabsContent value="description" className="grow mt-0">
|
||||
{children}
|
||||
{description}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user