Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
86 lines
2.9 KiB
TypeScript
86 lines
2.9 KiB
TypeScript
import React from "react";
|
|
import { HardDrive, Monitor, Plus } from "lucide-react";
|
|
import { Button } from "../ui/button";
|
|
import { SftpHostPicker } from "./SftpHostPicker";
|
|
import type { Host } from "../../domain/models";
|
|
import type { SftpConnectedHostEntry } from "../../domain/sftpConnectedHosts";
|
|
import type { SftpConnectHostOptions, SftpConnectTarget } from "./SftpContext";
|
|
|
|
interface SftpPaneEmptyStateProps {
|
|
side: "left" | "right";
|
|
showEmptyHeader: boolean;
|
|
t: (key: string, params?: Record<string, unknown>) => string;
|
|
showHostPicker: boolean;
|
|
setShowHostPicker: (open: boolean) => void;
|
|
hostSearch: string;
|
|
setHostSearch: (value: string) => void;
|
|
hosts: Host[];
|
|
connectedHosts?: SftpConnectedHostEntry[];
|
|
onConnect: (host: SftpConnectTarget, options?: SftpConnectHostOptions) => void;
|
|
}
|
|
|
|
export const SftpPaneEmptyState: React.FC<SftpPaneEmptyStateProps> = ({
|
|
side,
|
|
showEmptyHeader,
|
|
t,
|
|
showHostPicker,
|
|
setShowHostPicker,
|
|
hostSearch,
|
|
setHostSearch,
|
|
hosts,
|
|
connectedHosts = [],
|
|
onConnect,
|
|
}) => {
|
|
return (
|
|
<div className="absolute inset-0 flex flex-col">
|
|
{showEmptyHeader && (
|
|
<div className="h-12 px-4 border-b border-border/60 flex items-center gap-3 shrink-0">
|
|
<div className="flex items-center gap-2 text-sm font-semibold text-muted-foreground">
|
|
{side === "left" ? <Monitor size={14} /> : <HardDrive size={14} />}
|
|
<span>
|
|
{side === "left" ? t("sftp.pane.local") : t("sftp.pane.remote")}
|
|
</span>
|
|
</div>
|
|
<Button
|
|
variant="outline"
|
|
size="sm"
|
|
className="h-8 px-3"
|
|
onClick={() => setShowHostPicker(true)}
|
|
>
|
|
<Plus size={14} className="mr-2" /> {t("sftp.pane.selectHost")}
|
|
</Button>
|
|
</div>
|
|
)}
|
|
|
|
<div className="flex-1 flex flex-col items-center justify-center text-center gap-4 p-6">
|
|
<div className="h-14 w-14 rounded-xl bg-secondary/60 text-primary flex items-center justify-center">
|
|
{side === "left" ? <Monitor size={24} /> : <HardDrive size={24} />}
|
|
</div>
|
|
<div>
|
|
<div className="text-sm font-semibold mb-1">
|
|
{t("sftp.pane.selectHostToStart")}
|
|
</div>
|
|
<div className="text-xs text-muted-foreground">
|
|
{t("sftp.pane.chooseFilesystem")}
|
|
</div>
|
|
</div>
|
|
<Button onClick={() => setShowHostPicker(true)}>
|
|
<Plus size={14} className="mr-2" /> {t("sftp.pane.selectHost")}
|
|
</Button>
|
|
</div>
|
|
|
|
<SftpHostPicker
|
|
open={showHostPicker}
|
|
onOpenChange={setShowHostPicker}
|
|
hosts={hosts}
|
|
connectedHosts={connectedHosts}
|
|
side={side}
|
|
hostSearch={hostSearch}
|
|
onHostSearchChange={setHostSearch}
|
|
onSelectLocal={() => onConnect("local")}
|
|
onSelectHost={onConnect}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|