Files
Netcatty/application/state/sftp/sftpFocusStore.ts
T
陈大猫 ad3d0cfeda refactor: streamline codebase, unify duplicated modules, and consolidate test suite (#4307)
* refactor: streamline codebase, unify duplicated modules, and consolidate tests

* fix(test): batch discovered test files into Windows-safe command lines
2026-11-23 11:00:14 +08:00

25 lines
666 B
TypeScript

/**
* SFTP Focused Pane Store
*
* Tracks which SFTP pane (left or right) is currently focused.
* This is used to determine which pane should receive keyboard shortcut actions.
*/
import { createExternalStore } from "../createExternalStore";
export type SftpFocusedSide = "left" | "right";
const store = createExternalStore<SftpFocusedSide>("left");
export const sftpFocusStore = {
getSnapshot: store.getSnapshot,
subscribe: store.subscribe,
setFocusedSide: store.setSnapshot,
getFocusedSide: store.getSnapshot,
};
/**
* React hook to subscribe to focused side changes
*/
export const useSftpFocusedSide = (): SftpFocusedSide => store.useStore();