MCPcopy
hub / github.com/wavetermdev/waveterm / TabBarPreviewInner

Function TabBarPreviewInner

frontend/preview/previews/tabbar.preview.tsx:38–160  ·  view source on GitHub ↗
({ platform, setPlatform }: TabBarPreviewInnerProps)

Source from the content-addressed store, hash-verified

36};
37
38function TabBarPreviewInner({ platform, setPlatform }: TabBarPreviewInnerProps) {
39 const env = useWaveEnv<TabBarEnv>();
40 const loadBadgesEnv = useWaveEnv<LoadBadgesEnv>();
41 const [showConfigErrors, setShowConfigErrors] = useState(false);
42 const [hideAiButton, setHideAiButton] = useState(false);
43 const [showMenuBar, setShowMenuBar] = useState(false);
44 const [isFullScreen, setIsFullScreen] = useAtom(env.atoms.isFullScreen);
45 const [zoomFactor, setZoomFactor] = useAtom(env.atoms.zoomFactorAtom);
46 const [fullConfig, setFullConfig] = useAtom(env.atoms.fullConfigAtom);
47 const [updaterStatus, setUpdaterStatus] = useAtom(env.atoms.updaterStatusAtom);
48 const workspace = useAtomValue(env.wos.getWaveObjectAtom<Workspace>(`workspace:${TabBarMockWorkspaceId}`));
49
50 useEffect(() => {
51 loadBadges(loadBadgesEnv);
52 }, []);
53
54 useEffect(() => {
55 setFullConfig((prev) => ({
56 ...(prev ?? ({} as FullConfigType)),
57 settings: {
58 ...(prev?.settings ?? {}),
59 "app:hideaibutton": hideAiButton,
60 "window:showmenubar": showMenuBar,
61 },
62 configerrors: showConfigErrors ? MockConfigErrors : [],
63 }));
64 }, [hideAiButton, showMenuBar, setFullConfig, showConfigErrors]);
65
66 return (
67 <div className="flex w-full flex-col gap-6">
68 <div className="grid gap-4 rounded-md border border-border bg-panel p-4 md:grid-cols-3 mx-6 mt-6">
69 <label className="flex flex-col gap-2 text-xs text-muted">
70 <span>Platform</span>
71 <select
72 value={platform}
73 onChange={(event) => setPlatform(event.target.value as NodeJS.Platform)}
74 className="rounded border border-border bg-background px-2 py-1 text-foreground cursor-pointer"
75 >
76 <option value={PlatformMacOS}>macOS</option>
77 <option value={PlatformWindows}>Windows</option>
78 <option value={PlatformLinux}>Linux</option>
79 </select>
80 </label>
81 <label className="flex flex-col gap-2 text-xs text-muted">
82 <span>Updater banner</span>
83 <select
84 value={updaterStatus}
85 onChange={(event) => setUpdaterStatus(event.target.value as UpdaterStatus)}
86 className="rounded border border-border bg-background px-2 py-1 text-foreground"
87 >
88 <option value="up-to-date">Hidden</option>
89 <option value="ready">Update Available</option>
90 <option value="downloading">Downloading</option>
91 <option value="installing">Installing</option>
92 <option value="error">Error</option>
93 </select>
94 </label>
95 <label className="flex items-center gap-2 text-xs text-muted">

Callers

nothing calls this directly

Calls 3

useWaveEnvFunction · 0.90
loadBadgesFunction · 0.90
setPlatformFunction · 0.50

Tested by

no test coverage detected