The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { ScopedThreadRef } from "@t3tools/contracts"; |
| 2 | |
| 3 | import { browserMiniPlayerSource, usePreviewMiniPlayerStore } from "~/previewMiniPlayerStore"; |
| 4 | import { whenPreviewTabKnown } from "~/previewStateStore"; |
| 5 | import { useRightPanelStore } from "~/rightPanelStore"; |
| 6 | |
| 7 | export function showPreviewPopup( |
| 8 | threadRef: ScopedThreadRef, |
| 9 | popupTabId: string, |
| 10 | from: "panel" | "floating", |
| 11 | ): void { |
| 12 | whenPreviewTabKnown(threadRef, popupTabId, () => { |
| 13 | if (from === "floating") { |
| 14 | usePreviewMiniPlayerStore.getState().open(threadRef, browserMiniPlayerSource(popupTabId)); |
| 15 | } else { |
| 16 | useRightPanelStore.getState().openBrowser(threadRef, popupTabId); |
| 17 | } |
| 18 | }); |
| 19 | } |