refactor(layout): rename WorkspaceLayout to PlaygroundLayout and modify props

This commit is contained in:
cfngc4594 2025-03-08 21:11:18 +08:00
parent 4f6a37df17
commit a7799af2f4

View File

@ -1,17 +1,17 @@
import { WorkspaceHeader } from "@/components/workspace-header"; import { WorkspaceHeader } from "@/components/workspace-header";
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable"; import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
interface WorkspaceLayoutProps { interface PlaygroundLayoutProps {
problem: React.ReactNode; problem: React.ReactNode;
editor: React.ReactNode; workspace: React.ReactNode;
terminal: React.ReactNode; terminal: React.ReactNode;
} }
export default function WorkspaceLayout({ export default function PlaygroundLayout({
problem, problem,
editor, workspace,
terminal, terminal,
}: WorkspaceLayoutProps) { }: PlaygroundLayoutProps) {
return ( return (
<div className="h-screen flex flex-col"> <div className="h-screen flex flex-col">
<WorkspaceHeader /> <WorkspaceHeader />
@ -24,7 +24,7 @@ export default function WorkspaceLayout({
<ResizablePanel defaultSize={50}> <ResizablePanel defaultSize={50}>
<ResizablePanelGroup direction="vertical"> <ResizablePanelGroup direction="vertical">
<ResizablePanel defaultSize={75} className="border border-muted rounded-3xl"> <ResizablePanel defaultSize={75} className="border border-muted rounded-3xl">
{editor} {workspace}
</ResizablePanel> </ResizablePanel>
<ResizableHandle className="my-1 bg-transparent hover:bg-blue-500" /> <ResizableHandle className="my-1 bg-transparent hover:bg-blue-500" />
<ResizablePanel defaultSize={25} className="border border-muted rounded-3xl"> <ResizablePanel defaultSize={25} className="border border-muted rounded-3xl">