The best way to control Claude Code, Codex and more from any computer or phone

main
ts 17 lines 453 Bytes
Raw
1 import { useSyncExternalStore } from "react";
2
3 import { isElectron } from "../env";
4 import { createSoftwareKeyboardStore } from "../lib/softwareKeyboard";
5
6 const store = createSoftwareKeyboardStore(
7 typeof window === "undefined" ? undefined : window,
8 isElectron,
9 );
10
11 function getServerSnapshot() {
12 return false;
13 }
14
15 export function useSoftwareKeyboardOpen() {
16 return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
17 }