({ platform, setPlatform }: VTabBarPreviewInnerProps)
| 31 | }; |
| 32 | |
| 33 | function VTabBarPreviewInner({ platform, setPlatform }: VTabBarPreviewInnerProps) { |
| 34 | const env = useWaveEnv<VTabBarEnv>(); |
| 35 | const loadBadgesEnv = useWaveEnv<LoadBadgesEnv>(); |
| 36 | const [hideAiButton, setHideAiButton] = useState(false); |
| 37 | const [isFullScreen, setIsFullScreen] = useAtom(env.atoms.isFullScreen); |
| 38 | const [fullConfig, setFullConfig] = useAtom(env.atoms.fullConfigAtom); |
| 39 | const [updaterStatus, setUpdaterStatus] = useAtom(env.atoms.updaterStatusAtom); |
| 40 | const [width, setWidth] = useState<number>(220); |
| 41 | const workspace = useAtomValue(env.wos.getWaveObjectAtom<Workspace>(`workspace:${TabBarMockWorkspaceId}`)); |
| 42 | |
| 43 | useEffect(() => { |
| 44 | loadBadges(loadBadgesEnv); |
| 45 | }, []); |
| 46 | |
| 47 | useEffect(() => { |
| 48 | setFullConfig((prev) => ({ |
| 49 | ...(prev ?? ({} as FullConfigType)), |
| 50 | settings: { |
| 51 | ...(prev?.settings ?? {}), |
| 52 | "app:hideaibutton": hideAiButton, |
| 53 | }, |
| 54 | })); |
| 55 | }, [hideAiButton, setFullConfig]); |
| 56 | |
| 57 | return ( |
| 58 | <div className="flex w-full flex-col gap-6"> |
| 59 | <div className="grid gap-4 rounded-md border border-border bg-panel p-4 md:grid-cols-3 mx-6 mt-6"> |
| 60 | <label className="flex flex-col gap-2 text-xs text-muted"> |
| 61 | <span>Platform</span> |
| 62 | <select |
| 63 | value={platform} |
| 64 | onChange={(event) => setPlatform(event.target.value as NodeJS.Platform)} |
| 65 | className="rounded border border-border bg-background px-2 py-1 text-foreground cursor-pointer" |
| 66 | > |
| 67 | <option value={PlatformMacOS}>macOS</option> |
| 68 | <option value={PlatformWindows}>Windows</option> |
| 69 | <option value={PlatformLinux}>Linux</option> |
| 70 | </select> |
| 71 | </label> |
| 72 | <label className="flex flex-col gap-2 text-xs text-muted"> |
| 73 | <span>Updater banner</span> |
| 74 | <select |
| 75 | value={updaterStatus} |
| 76 | onChange={(event) => setUpdaterStatus(event.target.value as UpdaterStatus)} |
| 77 | className="rounded border border-border bg-background px-2 py-1 text-foreground" |
| 78 | > |
| 79 | <option value="up-to-date">Hidden</option> |
| 80 | <option value="ready">Update Available</option> |
| 81 | <option value="downloading">Downloading</option> |
| 82 | <option value="installing">Installing</option> |
| 83 | <option value="error">Error</option> |
| 84 | </select> |
| 85 | </label> |
| 86 | <label className="flex flex-col gap-2 text-xs text-muted"> |
| 87 | <span>Width: {width}px</span> |
| 88 | <input |
| 89 | type="range" |
| 90 | min={110} |
nothing calls this directly
no test coverage detected