@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 19 lines 677 Bytes
Raw
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 }