2025-06-06 19:38:16 +00:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
|
2025-05-28 23:08:42 +00:00
|
|
|
import { BottomPanel } from "./components/bottomPanel";
|
|
|
|
|
import { AnimatedResizableHandle } from "@/components/ui/animatedResizableHandle";
|
|
|
|
|
import { BrowseStateProvider } from "./browseStateProvider";
|
2025-06-06 19:38:16 +00:00
|
|
|
import { FileTreePanel } from "@/features/fileTree/components/fileTreePanel";
|
|
|
|
|
import { TopBar } from "@/app/[domain]/components/topBar";
|
|
|
|
|
import { useBrowseParams } from "./hooks/useBrowseParams";
|
2025-06-09 19:51:35 +00:00
|
|
|
import { FileSearchCommandDialog } from "./components/fileSearchCommandDialog";
|
2025-07-23 18:25:15 +00:00
|
|
|
import { useDomain } from "@/hooks/useDomain";
|
|
|
|
|
import { SearchBar } from "../components/searchBar";
|
2025-05-28 23:08:42 +00:00
|
|
|
|
|
|
|
|
interface LayoutProps {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function Layout({
|
2025-07-23 18:25:15 +00:00
|
|
|
children,
|
2025-05-28 23:08:42 +00:00
|
|
|
}: LayoutProps) {
|
2025-06-06 19:38:16 +00:00
|
|
|
const { repoName, revisionName } = useBrowseParams();
|
2025-07-23 18:25:15 +00:00
|
|
|
const domain = useDomain();
|
2025-06-06 19:38:16 +00:00
|
|
|
|
2025-05-28 23:08:42 +00:00
|
|
|
return (
|
|
|
|
|
<BrowseStateProvider>
|
|
|
|
|
<div className="flex flex-col h-screen">
|
2025-07-23 18:25:15 +00:00
|
|
|
<TopBar
|
|
|
|
|
domain={domain}
|
|
|
|
|
>
|
|
|
|
|
<SearchBar
|
|
|
|
|
size="sm"
|
2025-11-22 23:33:31 +00:00
|
|
|
defaults={{
|
|
|
|
|
query: `repo:${repoName}${revisionName ? ` rev:${revisionName}` : ''} `,
|
|
|
|
|
}}
|
2025-07-23 18:25:15 +00:00
|
|
|
className="w-full"
|
2025-06-06 19:38:16 +00:00
|
|
|
/>
|
2025-07-23 18:25:15 +00:00
|
|
|
</TopBar>
|
2025-05-28 23:08:42 +00:00
|
|
|
<ResizablePanelGroup
|
2025-06-06 19:38:16 +00:00
|
|
|
direction="horizontal"
|
2025-05-28 23:08:42 +00:00
|
|
|
>
|
2025-06-06 19:38:16 +00:00
|
|
|
<FileTreePanel order={1} />
|
|
|
|
|
|
2025-05-28 23:08:42 +00:00
|
|
|
<AnimatedResizableHandle />
|
2025-06-06 19:38:16 +00:00
|
|
|
|
|
|
|
|
<ResizablePanel
|
|
|
|
|
order={2}
|
|
|
|
|
minSize={10}
|
|
|
|
|
defaultSize={80}
|
|
|
|
|
id="code-preview-panel-container"
|
|
|
|
|
>
|
|
|
|
|
<ResizablePanelGroup
|
|
|
|
|
direction="vertical"
|
|
|
|
|
>
|
|
|
|
|
<ResizablePanel
|
|
|
|
|
order={1}
|
|
|
|
|
id="code-preview-panel"
|
|
|
|
|
>
|
2025-07-23 18:25:15 +00:00
|
|
|
{children}
|
2025-06-06 19:38:16 +00:00
|
|
|
</ResizablePanel>
|
|
|
|
|
<AnimatedResizableHandle />
|
|
|
|
|
<BottomPanel
|
|
|
|
|
order={2}
|
|
|
|
|
/>
|
|
|
|
|
</ResizablePanelGroup>
|
|
|
|
|
</ResizablePanel>
|
2025-05-28 23:08:42 +00:00
|
|
|
</ResizablePanelGroup>
|
|
|
|
|
</div>
|
2025-06-09 19:51:35 +00:00
|
|
|
<FileSearchCommandDialog />
|
2025-05-28 23:08:42 +00:00
|
|
|
</BrowseStateProvider>
|
|
|
|
|
);
|
2025-06-09 19:51:35 +00:00
|
|
|
}
|