File size: 21,233 Bytes
8800c81
 
 
1993562
5c86297
8800c81
 
 
 
 
 
 
 
 
 
7676842
f0175ec
aa1fcca
ccd47e0
8800c81
 
5c86297
 
 
8800c81
5c86297
 
 
 
 
 
 
 
 
 
8800c81
 
 
 
 
 
 
 
5c86297
 
 
8800c81
5c86297
 
 
 
 
 
 
 
 
 
8800c81
 
 
 
 
 
5c86297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
 
 
f0175ec
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53d8367
 
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1993562
f0175ec
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f0175ec
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7676842
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1993562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664a5eb
 
c7fe97e
664a5eb
 
 
 
 
 
 
 
8800c81
ccd47e0
f0175ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa1fcca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8800c81
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
import React, { lazy, Suspense, useCallback } from 'react';
import WindowShell from '../WindowShell';
import type { WindowsMap } from '../../types/windowTypes';
import type { ProblemItem } from '../../types/reviewTypes';
import { useOSStore } from '../../stores/useOSStore';

const ReviewQueue = lazy(() => import('../ReviewQueue'));
const JourneyPath = lazy(() => import('../JourneyPath'));
const TerminalEmulator = lazy(() => import('../TerminalEmulator'));
const PythonChallenge = lazy(() => import('../PythonChallenge'));
const MySQLPlayground = lazy(() => import('../MySQLPlayground'));
const FileExplorer = lazy(() => import('../FileExplorer'));
const Settings = lazy(() => import('../Settings'));
const CreateProblemForm = lazy(() => import('../CreateProblemForm'));
const PrincessChamber = lazy(() => import('../../features/companion/components/PrincessChamber'));
const GitHubSyncWindow = lazy(() => import('../GitHubSyncWindow'));
const CardManager = lazy(() => import('../card-manager/CardManager'));
const StoreWindow = lazy(() => import('../store/StoreWindow'));


interface DesktopWindowContainerProps {
  windows?: WindowsMap;
  activeWindow?: string;
  setActiveWindow?: (id: string) => void;
  isMobile: boolean;
  openWindow?: (id: string) => void;
  closeWindow?: (id: string) => void;
  minimizeWindow?: (id: string) => void;
  overrideProblemId?: string | null;
  setOverrideProblemId?: (id: string | null) => void;
  editingProblem?: ProblemItem | null;
  openEditProblem?: (problem: ProblemItem) => void;
  handleSelectProblemForReview?: (problemId: string) => void;
  refreshExplorerTrigger?: number;
  triggerRefreshExplorer?: () => void;
  wallpaperUrl: string;
  setWallpaperUrl: (url: string) => void;
  syncing: boolean;
  syncResult: string | null;
  triggerSync: () => void;
}

export const DesktopWindowContainer: React.FC<DesktopWindowContainerProps> = ({
  windows: propsWindows,
  activeWindow: propsActiveWindow,
  setActiveWindow: propsSetActiveWindow,
  isMobile,
  openWindow: propsOpenWindow,
  closeWindow: propsCloseWindow,
  minimizeWindow: propsMinimizeWindow,
  overrideProblemId: propsOverrideProblemId,
  setOverrideProblemId: propsSetOverrideProblemId,
  editingProblem: propsEditingProblem,
  openEditProblem: propsOpenEditProblem,
  handleSelectProblemForReview: propsHandleSelectProblem,
  refreshExplorerTrigger: propsRefreshExplorerTrigger,
  triggerRefreshExplorer: propsTriggerRefreshExplorer,
  wallpaperUrl,
  setWallpaperUrl,
  syncing,
  syncResult,
  triggerSync
}) => {
  const storeWindows = useOSStore(s => s.windows);
  const storeActiveWindow = useOSStore(s => s.activeWindow);
  const storeSetActiveWindow = useOSStore(s => s.setActiveWindow);
  const storeOpenWindow = useOSStore(s => s.openWindow);
  const storeCloseWindow = useOSStore(s => s.closeWindow);
  const storeMinimizeWindow = useOSStore(s => s.minimizeWindow);
  const storeOverrideProblemId = useOSStore(s => s.overrideProblemId);
  const storeSetOverrideProblemId = useOSStore(s => s.setOverrideProblemId);
  const storeEditingProblem = useOSStore(s => s.editingProblem);
  const storeOpenEditProblem = useOSStore(s => s.openEditProblem);
  const storeHandleSelectProblem = useOSStore(s => s.handleSelectProblemForReview);
  const storeRefreshTrigger = useOSStore(s => s.refreshExplorerTrigger);
  const storeTriggerRefresh = useOSStore(s => s.triggerRefreshExplorer);

  const windows = propsWindows ?? storeWindows;
  const activeWindow = propsActiveWindow ?? storeActiveWindow;
  const setActiveWindow = propsSetActiveWindow ?? storeSetActiveWindow;
  const openWindow = propsOpenWindow ?? storeOpenWindow;
  const closeWindow = propsCloseWindow ?? storeCloseWindow;
  const minimizeWindow = propsMinimizeWindow ?? storeMinimizeWindow;
  const overrideProblemId = propsOverrideProblemId !== undefined ? propsOverrideProblemId : storeOverrideProblemId;
  const setOverrideProblemId = propsSetOverrideProblemId ?? storeSetOverrideProblemId;
  const editingProblem = propsEditingProblem !== undefined ? propsEditingProblem : storeEditingProblem;
  const openEditProblem = propsOpenEditProblem ?? storeOpenEditProblem;
  const handleSelectProblemForReview = propsHandleSelectProblem ?? storeHandleSelectProblem;
  const refreshExplorerTrigger = propsRefreshExplorerTrigger ?? storeRefreshTrigger;
  const triggerRefreshExplorer = propsTriggerRefreshExplorer ?? storeTriggerRefresh;
  const handleClearOverride = useCallback(() => setOverrideProblemId(null), [setOverrideProblemId]);
  const handleOpenJourney = useCallback(() => openWindow('journey'), [openWindow]);
  const handleOpenCreateProblem = useCallback(() => openWindow('createProblem'), [openWindow]);
  const handleOpenCardManager = useCallback(() => openWindow('cardManager'), [openWindow]);

  return (
    <>
      {/* 1. Daily Review Queue Window */}
      <WindowShell
        id="queue"
        title="Daily Queue.exe"
        icon="terminal"
        isOpen={windows.queue.isOpen}
        isMinimized={windows.queue.isMinimized}
        onClose={() => closeWindow('queue')}
        onMinimize={() => minimizeWindow('queue')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="980px"
        defaultHeight="680px"
        minWidth={440}
        minHeight={360}
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading ReviewQueue.exe...
            </div>
          }
        >
          <ReviewQueue
            overrideProblemId={overrideProblemId}
            onClearOverride={handleClearOverride}
            onOpenWindow={openWindow}
            onOpenJourney={handleOpenJourney}
            onOpenCreateProblem={handleOpenCreateProblem}
            onOpenEditProblem={openEditProblem}
            onOpenCardManager={handleOpenCardManager}
            refreshTrigger={refreshExplorerTrigger}
          />
        </Suspense>
      </WindowShell>

      {/* 2. Journey Path Map Window */}
      <WindowShell
        id="journey"
        title="Journey_Path.exe"
        icon="route"
        isOpen={windows.journey.isOpen}
        isMinimized={windows.journey.isMinimized}
        onClose={() => closeWindow('journey')}
        onMinimize={() => minimizeWindow('journey')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="980px"
        defaultHeight="680px"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading JourneyPath.exe...
            </div>
          }
        >
          <JourneyPath onSelectProblemForReview={handleSelectProblemForReview} />
        </Suspense>
      </WindowShell>

      {/* 3. Command Line Terminal Window */}
      <WindowShell
        id="terminal"
        title="Arcade Terminal.com"
        icon="terminal"
        isOpen={windows.terminal.isOpen}
        isMinimized={windows.terminal.isMinimized}
        onClose={() => closeWindow('terminal')}
        onMinimize={() => minimizeWindow('terminal')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="640px"
        defaultHeight="450px"
        titleBarColor="#1e293b"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading Terminal.exe...
            </div>
          }
        >
          <TerminalEmulator onOpenWindow={openWindow} onClose={() => closeWindow('terminal')} />
        </Suspense>
      </WindowShell>

      {/* 4. Google Drive Sync Dialog Window */}
      <WindowShell
        id="sync"
        title="Drive_Sync.sys"
        icon="cloud_sync"
        isOpen={windows.sync.isOpen}
        isMinimized={windows.sync.isMinimized}
        onClose={() => closeWindow('sync')}
        onMinimize={() => minimizeWindow('sync')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="480px"
        defaultHeight="320px"
        titleBarColor="#855400"
        isMobile={isMobile}
      >
        <div className="w-full h-full bg-[#fdf8e1] p-6 flex flex-col justify-between">
          <div className="space-y-4">
            <div className="flex items-center gap-3 border-b-2 border-dashed border-ink-black pb-3">
              <span className="material-symbols-outlined text-4xl text-[#855400] animate-bounce">
                cloud_sync
              </span>
              <div>
                <h4 className="font-arcade text-[10px] font-bold text-ink-black">
                  DRIVE NOTES SYNCHRONIZATION
                </h4>
                <span className="text-[8px] font-arcade text-trash-gray font-bold uppercase mt-1 block">
                  Importing LeetCode sheets
                </span>
              </div>
            </div>

            {syncing ? (
              <div className="space-y-3 py-2">
                <span className="text-[9px] font-arcade text-ink-black font-bold block animate-pulse">
                  SYNC PROCESS RUNNING...
                </span>
                <div className="w-full h-6 bg-white border-[3px] border-ink-black relative overflow-hidden select-none">
                  <div className="absolute inset-y-0 left-0 bg-[#ffe24c] border-r-2 border-ink-black w-[75%] animate-pulse" />
                </div>
                <p className="text-[9px] font-sans text-trash-gray leading-normal font-semibold">
                  Connecting to Supabase partition, requesting Google Drive manifest, indexing note items...
                </p>
              </div>
            ) : (
              <div className="p-3 bg-white border-[3px] border-ink-black text-xs font-semibold text-ink-black leading-relaxed shadow-[2px_2px_0px_0px_#1E293B]">
                {syncResult || 'Idle. Ready to synchronize review data logs from Sheets drive storage.'}
              </div>
            )}
          </div>

          <div className="flex gap-3 justify-end pt-4 border-t border-slate-200">
            <button
              onClick={() => closeWindow('sync')}
              className="px-4 py-2 bg-white hover:bg-slate-100 text-ink-black border-[3px] border-ink-black font-bold text-xs shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer"
            >
              CLOSE
            </button>
            <button
              onClick={triggerSync}
              disabled={syncing}
              className="px-4 py-2 bg-[#ffcc00] hover:bg-yellow-300 text-ink-black border-[3px] border-ink-black font-bold text-xs shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none disabled:opacity-50 cursor-pointer"
            >
              {syncing ? 'SYNCING...' : 'SYNC NOW'}
            </button>
          </div>
        </div>
      </WindowShell>

      {/* GitHub Solutions Sync Station Window */}
      <WindowShell
        id="github"
        title="GitHub_Sync.exe"
        icon="terminal"
        isOpen={windows.github?.isOpen ?? false}
        isMinimized={windows.github?.isMinimized ?? false}
        onClose={() => closeWindow('github')}
        onMinimize={() => minimizeWindow('github')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="620px"
        defaultHeight="520px"
        titleBarColor="#24292e"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading GitHub_Sync.exe...
            </div>
          }
        >
          <GitHubSyncWindow onClose={() => closeWindow('github')} />
        </Suspense>
      </WindowShell>

      {/* 5. My Computer Window (Interactive File Explorer) */}
      <WindowShell
        id="computer"
        title="File Explorer"
        icon="desktop_windows"
        isOpen={windows.computer.isOpen}
        isMinimized={windows.computer.isMinimized}
        onClose={() => closeWindow('computer')}
        onMinimize={() => minimizeWindow('computer')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="640px"
        defaultHeight="480px"
        titleBarColor="#006686"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading FileExplorer.exe...
            </div>
          }
        >
          <FileExplorer
            onSetWallpaper={setWallpaperUrl}
            activeWallpaperUrl={wallpaperUrl}
            onOpenCreateProblem={() => openWindow('createProblem')}
            onOpenQueue={() => openWindow('queue')}
            onOpenJourney={() => openWindow('journey')}
            refreshTrigger={refreshExplorerTrigger}
          />
        </Suspense>
      </WindowShell>

      {/* 5b. Create Problem Window */}
      {windows.createProblem?.isOpen && (
        <WindowShell
          id="createProblem"
          title="Create Problem"
          icon="note_add"
          isOpen={windows.createProblem.isOpen}
          isMinimized={windows.createProblem.isMinimized}
          onClose={() => closeWindow('createProblem')}
          onMinimize={() => minimizeWindow('createProblem')}
          activeWindow={activeWindow}
          setActiveWindow={setActiveWindow}
          defaultWidth="640px"
          defaultHeight="700px"
          titleBarColor="#a855f7"
          isMobile={isMobile}
        >
          <Suspense
            fallback={
              <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
                Loading CreateForm.exe...
              </div>
            }
          >
            <CreateProblemForm
              onClose={() => closeWindow('createProblem')}
              onSuccess={() => {
                triggerRefreshExplorer();
                openWindow('queue');
              }}
            />
          </Suspense>
        </WindowShell>
      )}

      {/* 5c. Edit Problem Window */}
      {windows.editProblem?.isOpen && (
        <WindowShell
          id="editProblem"
          title={
            editingProblem
              ? `Edit Problem: #${editingProblem.problem_number ?? '—'} ${editingProblem.name}`
              : 'Edit Problem'
          }
          icon="edit_note"
          isOpen={windows.editProblem.isOpen}
          isMinimized={windows.editProblem.isMinimized}
          onClose={() => closeWindow('editProblem')}
          onMinimize={() => minimizeWindow('editProblem')}
          activeWindow={activeWindow}
          setActiveWindow={setActiveWindow}
          defaultWidth="760px"
          defaultHeight="720px"
          defaultX={30}
          defaultY={25}
          titleBarColor="#059669"
          isMobile={isMobile}
        >
          <Suspense
            fallback={
              <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
                Loading EditProblem.exe...
              </div>
            }
          >
            <CreateProblemForm
              key={editingProblem?.id || (editingProblem?.problem_number !== undefined ? String(editingProblem.problem_number) : 'edit-problem')}
              mode="edit"
              initialProblem={editingProblem}
              onClose={() => closeWindow('editProblem')}
              onSuccess={() => {
                closeWindow('editProblem');
                triggerRefreshExplorer();
                openWindow('queue');
              }}
            />
          </Suspense>
        </WindowShell>
      )}

      {/* 6. Daily Python Challenge Window */}
      <WindowShell
        id="python"
        title="Python Challenge"
        icon="sports_esports"
        isOpen={windows.python.isOpen}
        isMinimized={windows.python.isMinimized}
        onClose={() => closeWindow('python')}
        onMinimize={() => minimizeWindow('python')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="620px"
        defaultHeight="580px"
        titleBarColor="#9d4edd"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading PythonChallenge.exe...
            </div>
          }
        >
          <PythonChallenge />
        </Suspense>
      </WindowShell>

      {/* 7. MySQL Playground Window */}
      <WindowShell
        id="mysql"
        title="MySQL Playground"
        icon="database"
        isOpen={windows.mysql.isOpen}
        isMinimized={windows.mysql.isMinimized}
        onClose={() => closeWindow('mysql')}
        onMinimize={() => minimizeWindow('mysql')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="660px"
        defaultHeight="580px"
        titleBarColor="#0ea5e9"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading MySQLPlayground.exe...
            </div>
          }
        >
          <MySQLPlayground />
        </Suspense>
      </WindowShell>

      {/* 8. API Control Panel Window */}
      <WindowShell
        id="settings"
        title="API Configuration"
        icon="key"
        isOpen={windows.settings?.isOpen}
        isMinimized={windows.settings?.isMinimized}
        onClose={() => closeWindow('settings')}
        onMinimize={() => minimizeWindow('settings')}
        activeWindow={activeWindow}
        setActiveWindow={setActiveWindow}
        defaultWidth="520px"
        defaultHeight="460px"
        titleBarColor="#10b981"
        isMobile={isMobile}
      >
        <Suspense
          fallback={
            <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
              Loading APIConfig.exe...
            </div>
          }
        >
          <Settings />
        </Suspense>
      </WindowShell>

      {/* 9. Princess Tower Companion - JRPG Dialogue Stage */}
      {windows.companion?.isOpen && !windows.companion.isMinimized && (
        <Suspense fallback={null}>
          <PrincessChamber
            onClose={() => closeWindow('companion')}
            onMinimize={() => minimizeWindow('companion')}
            isActive={activeWindow === 'companion'}
            onFocus={() => setActiveWindow('companion')}
            isMobile={isMobile}
          />
        </Suspense>
      )}

      {/* 10. Anki Card Manager Window */}
      {windows.cardManager?.isOpen && (
        <WindowShell
          id="cardManager"
          title="FSRS Card Manager"
          icon="style"
          isOpen={windows.cardManager.isOpen}
          isMinimized={windows.cardManager.isMinimized}
          onClose={() => closeWindow('cardManager')}
          onMinimize={() => minimizeWindow('cardManager')}
          activeWindow={activeWindow}
          setActiveWindow={setActiveWindow}
          defaultWidth="1020px"
          defaultHeight="700px"
          minWidth={520}
          minHeight={420}
          titleBarColor="#0284c7"
          isMobile={isMobile}
        >
          <Suspense
            fallback={
              <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
                Loading CardManager.exe...
              </div>
            }
          >
            <CardManager
              onOpenQueue={() => openWindow('queue')}
              onOpenCreateProblem={() => openWindow('createProblem')}
              onOpenEditProblem={openEditProblem}
              onSelectProblemForReview={handleSelectProblemForReview}
              refreshTrigger={refreshExplorerTrigger}
              onRefreshExplorer={triggerRefreshExplorer}
            />
          </Suspense>
        </WindowShell>
      )}

      {/* 13. Store Window */}
      {windows.store?.isOpen && (
        <WindowShell
          id="store"
          title="Store"
          icon="storefront"
          isOpen={windows.store.isOpen}
          isMinimized={windows.store.isMinimized}
          onClose={() => closeWindow('store')}
          onMinimize={() => minimizeWindow('store')}
          activeWindow={activeWindow}
          setActiveWindow={setActiveWindow}
          defaultWidth="940px"
          defaultHeight="660px"
          minWidth={460}
          minHeight={380}
          titleBarColor="#d97706"
          isMobile={isMobile}
        >
          <Suspense
            fallback={
              <div className="p-6 font-arcade text-xs text-trash-gray uppercase animate-pulse">
                Loading Emporium.sys...
              </div>
            }
          >
            <StoreWindow
              onClose={() => closeWindow('store')}
              onOpenCompanion={() => openWindow('companion')}
            />
          </Suspense>
        </WindowShell>
      )}

    </>
  );
};