mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
36267717ac
Introduce workspace-aware System side panel with remote process/tmux/Docker management, terminal popup for interactive attach, capability warmup, review-hardened IPC, performance optimizations, toast action errors, and SSH channel recovery on reconnect.
22 lines
766 B
TypeScript
22 lines
766 B
TypeScript
import { useCallback } from 'react';
|
|
import { netcattyBridge } from '../../infrastructure/services/netcattyBridge';
|
|
import type { TerminalPopupPayload } from '../../domain/systemManager/types';
|
|
|
|
export function useTerminalPopupWindow() {
|
|
const close = useCallback(async () => {
|
|
await netcattyBridge.get()?.windowClose?.();
|
|
}, []);
|
|
|
|
const setWindowTitle = useCallback(async (title: string) => {
|
|
await netcattyBridge.get()?.setWindowTitle?.(title);
|
|
}, []);
|
|
|
|
const onPopupConfig = useCallback((cb: (payload: TerminalPopupPayload) => void) => {
|
|
const bridge = netcattyBridge.get();
|
|
if (!bridge?.onTerminalPopupConfig) return () => {};
|
|
return bridge.onTerminalPopupConfig(cb);
|
|
}, []);
|
|
|
|
return { close, setWindowTitle, onPopupConfig };
|
|
}
|