The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { useNavigation } from "@react-navigation/native"; |
| 2 | |
| 3 | import { useOpenThreadInspector } from "../threads/thread-inspector-navigation"; |
| 4 | |
| 5 | /** Opens an environment's localhost page on this device: in the inspector pane where there is one. */ |
| 6 | export function useOpenLocalPreview() { |
| 7 | const navigation = useNavigation(); |
| 8 | const openInspector = useOpenThreadInspector(); |
| 9 | return (source: { readonly environmentId: string; readonly threadId: string }, url: string) => { |
| 10 | if (openInspector(source, { type: "localPreview", ...source, url })) return; |
| 11 | navigation.navigate("ThreadLocalPreview", { environmentId: source.environmentId, url }); |
| 12 | }; |
| 13 | } |