import { cn as e } from "../../../lib/utils.js";
import { Button as t } from "../../../components/ui/button.js";
import { FileContentViewer as n } from "../../code-explorer/components/FileContentViewer.js";
import "../../code-explorer/index.js";
import { useOptionalRemoteFileExplorer as r } from "../providers/RemoteFileExplorerProvider.js";
import { useWorkbenchLayout as i } from "../providers/WorkbenchLayoutProvider.js";
import { RemoteFileTabsBar as a } from "./RemoteFileTabsBar.js";
import o from "./RemoteFileTree.js";
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
import { X as u } from "lucide-react";
//#region src/features/workbench/components/WorkbenchFilesPanel.tsx
function d() {
	let { closeSidePanel: d, fileExplorerEnabled: f } = i(), p = r();
	return f ? /* @__PURE__ */ l("div", {
		className: "border-l bg-background flex w-2/3 shrink-0 flex-col",
		children: [/* @__PURE__ */ l("div", {
			className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
			children: [/* @__PURE__ */ c("span", {
				className: "text-sm font-medium",
				children: "Files"
			}), /* @__PURE__ */ c(t, {
				variant: "ghost",
				size: "icon",
				className: e("h-5 w-5 shrink-0 rounded transition-opacity", "hover:bg-destructive/10 hover:text-destructive"),
				onClick: d,
				"aria-label": "Close Files Panel",
				children: /* @__PURE__ */ c(u, { className: "h-3.5 w-3.5" })
			})]
		}), /* @__PURE__ */ c("div", {
			className: "flex-1 overflow-hidden flex",
			children: p ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
				className: "w-64 shrink-0 border-r bg-muted/40",
				children: /* @__PURE__ */ c(o, {})
			}), /* @__PURE__ */ l("div", {
				className: "flex-1 flex flex-col min-w-0",
				children: [/* @__PURE__ */ c(a, {}), /* @__PURE__ */ c("div", {
					className: "flex-1 overflow-hidden p-3 pt-2",
					children: /* @__PURE__ */ c(n, {
						selectedFile: p.selectedFile,
						content: p.fileContent,
						isLoading: p.isContentLoading,
						className: "h-full"
					})
				})]
			})] }) : /* @__PURE__ */ c("div", {
				className: "flex-1 flex items-center justify-center p-4",
				children: /* @__PURE__ */ c("p", {
					className: "text-sm text-muted-foreground",
					children: "Remote file explorer is not available for this workspace."
				})
			})
		})]
	}) : null;
}
//#endregion
export { d as WorkbenchFilesPanel };
