import { Icon } from "../../icon"; import { FileBrowser } from "./FileBrowser"; import { FileEditor } from "../git/file-editor"; import { CommitPanel } from "../git/commit-panel"; import { GitToolbar } from "../git/git-toolbar"; import { InstanceList } from "../tool/instance-list"; import type { GitRepository, GitStatus } from "../../../api/git-repositories"; import type { ToolType } from "../../../api/tool-types"; import type { Project } from "../../../hooks/use-repo-workspace"; type MobileTab = "files" | "editor" | "git" | "terminal"; interface Props { projectId: string; project: Project | null; isMobile: boolean; mobileTab: MobileTab; selectedRepoId: string | null; selectedRepo: GitRepository | undefined; branches: string[]; currentBranch: string; gitStatus: GitStatus | null; toolTypes: ToolType[]; repositories: GitRepository[]; onMobileTabChange: (tab: MobileTab) => void; onRepoChange: (repoId: string) => void; onBranchChange: (branch: string) => void; onRefresh: () => void; } export const WorkspaceLayout = ({ projectId, project, isMobile, mobileTab, selectedRepoId, selectedRepo, branches, currentBranch, gitStatus, toolTypes, repositories, onMobileTabChange, onRepoChange, onBranchChange, onRefresh, }: Props) => { if (isMobile) { return (
{selectedRepoId && ( )}
{mobileTab === "files" && selectedRepoId && ( )} {mobileTab === "editor" && selectedRepoId && ( )} {mobileTab === "git" && selectedRepoId && gitStatus && (
{ onRefresh(); }} />
)} {mobileTab === "terminal" && selectedRepoId && ( )}
); } return ( <> {selectedRepoId && ( )}
{selectedRepoId && ( )}
); };