@umituz/web-virtual 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-virtual",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Universal 3D Virtual Environment Engine for Web & React — Offices, Farms, Factories, Schools, Hospitals with 60fps performance, raycasting and interactive entities.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -0,0 +1,658 @@
1
+ import {
2
+ type ReactNode,
3
+ useState,
4
+ useRef,
5
+ useCallback,
6
+ useMemo,
7
+ } from 'react'
8
+ import {
9
+ Building2,
10
+ Compass,
11
+ LayoutDashboard,
12
+ Terminal,
13
+ RefreshCw,
14
+ ExternalLink,
15
+ ArrowRight,
16
+ Maximize2,
17
+ Minimize2,
18
+ PanelRightClose,
19
+ PanelRightOpen,
20
+ Sparkles,
21
+ Zap,
22
+ Clock,
23
+ FolderKanban,
24
+ Activity,
25
+ Bot,
26
+ Send,
27
+ Loader2,
28
+ Eye,
29
+ } from 'lucide-react'
30
+ import type { WorldDefinition, WorldEntity, WorldPreset } from '../core/types'
31
+ import { VirtualWorld, type VirtualWorldRef } from './VirtualWorld'
32
+ import { VirtualCommandBar, type PresetMission } from './VirtualCommandBar'
33
+ import { VirtualRoster } from './VirtualRoster'
34
+ import { VirtualEntityDrawer, type EntityRunMetrics, type EntityLatestTask } from './VirtualEntityDrawer'
35
+ import { VirtualReportModal, type VirtualReportData } from './VirtualReportModal'
36
+ import { DEFAULT_OFFICE_DEPARTMENTS, type DepartmentInfo } from '../presets/officePreset'
37
+
38
+ export type OperationalMode = 'office' | 'operations' | 'command_center'
39
+
40
+ export interface DigitalHQProject {
41
+ id: string
42
+ name: string
43
+ description?: string
44
+ status?: string
45
+ }
46
+
47
+ export interface DigitalHQActivity {
48
+ id: string
49
+ title: string
50
+ description?: string
51
+ createdAt: string
52
+ }
53
+
54
+ export interface DigitalHQViewProps {
55
+ world: WorldDefinition
56
+ preset?: WorldPreset
57
+ departments?: DepartmentInfo[]
58
+ presetMissions?: PresetMission[]
59
+ projects?: DigitalHQProject[]
60
+ activities?: DigitalHQActivity[]
61
+ standalone?: boolean
62
+ loading?: boolean
63
+ refreshing?: boolean
64
+ onRefresh?: () => void
65
+ onSeedSquad?: () => void
66
+ isSeeding?: boolean
67
+ onDispatchMission: (data: { prompt: string; targetId: string; isDemo: boolean }) => Promise<void> | void
68
+ selectedEntityId?: string | null
69
+ onSelectEntity?: (entity: WorldEntity | null) => void
70
+ getEntityMetrics?: (entityId: string) => EntityRunMetrics | undefined
71
+ getEntityLatestTask?: (entityId: string) => EntityLatestTask | null
72
+ returnUrl?: string
73
+ standaloneUrl?: string
74
+ className?: string
75
+ }
76
+
77
+ export function DigitalHQView({
78
+ world,
79
+ preset,
80
+ departments = DEFAULT_OFFICE_DEPARTMENTS,
81
+ presetMissions = [],
82
+ projects = [],
83
+ activities = [],
84
+ standalone = true,
85
+ loading = false,
86
+ refreshing = false,
87
+ onRefresh,
88
+ onSeedSquad,
89
+ isSeeding = false,
90
+ onDispatchMission,
91
+ selectedEntityId,
92
+ onSelectEntity,
93
+ getEntityMetrics,
94
+ getEntityLatestTask,
95
+ returnUrl = '/app/office',
96
+ standaloneUrl = '/digital-hq',
97
+ className = '',
98
+ }: DigitalHQViewProps): ReactNode {
99
+ // Navigation Mode
100
+ const [activeMode, setActiveMode] = useState<OperationalMode>('office')
101
+
102
+ // Layout / Sidebar
103
+ const virtualWorldRef = useRef<VirtualWorldRef>(null)
104
+ const [showRoster, setShowRoster] = useState(true)
105
+ const [isFullscreen, setIsFullscreen] = useState(false)
106
+
107
+ // Selection & Report
108
+ const [internalSelectedId, setInternalSelectedId] = useState<string | null>(null)
109
+ const [viewingReport, setViewingReport] = useState<VirtualReportData | null>(null)
110
+
111
+ const activeEntityId = selectedEntityId !== undefined ? selectedEntityId : internalSelectedId
112
+ const activeEntity = world.entities.find((e) => e.id === activeEntityId) || null
113
+
114
+ // Command Bar & Dispatch
115
+ const [targetId, setTargetId] = useState<string>('auto')
116
+ const [promptText, setPromptText] = useState('')
117
+ const [isDemoMode, setIsDemoMode] = useState(true)
118
+ const [isLaunching, setIsLaunching] = useState(false)
119
+
120
+ // Roster Search & Category
121
+ const [rosterSearch, setRosterSearch] = useState('')
122
+ const [selectedCategory, setSelectedCategory] = useState('all')
123
+
124
+ const handleSelect = useCallback(
125
+ (entity: WorldEntity | null) => {
126
+ setInternalSelectedId(entity ? entity.id : null)
127
+ if (onSelectEntity) onSelectEntity(entity)
128
+ if (entity) {
129
+ virtualWorldRef.current?.focusOnEntity(entity.id)
130
+ }
131
+ },
132
+ [onSelectEntity],
133
+ )
134
+
135
+ const handleToggleRoster = useCallback(() => {
136
+ setShowRoster((prev) => {
137
+ const next = !prev
138
+ setTimeout(() => virtualWorldRef.current?.resize(), 50)
139
+ return next
140
+ })
141
+ }, [])
142
+
143
+ const handleToggleFullscreen = useCallback(() => {
144
+ if (!document.fullscreenElement) {
145
+ void document.documentElement.requestFullscreen().then(() => {
146
+ setIsFullscreen(true)
147
+ setTimeout(() => virtualWorldRef.current?.resize(), 100)
148
+ })
149
+ } else {
150
+ void document.exitFullscreen().then(() => {
151
+ setIsFullscreen(false)
152
+ setTimeout(() => virtualWorldRef.current?.resize(), 100)
153
+ })
154
+ }
155
+ }, [])
156
+
157
+ const handleDispatch = useCallback(async () => {
158
+ if (!promptText.trim()) return
159
+ setIsLaunching(true)
160
+ try {
161
+ await onDispatchMission({
162
+ prompt: promptText.trim(),
163
+ targetId,
164
+ isDemo: isDemoMode,
165
+ })
166
+ setPromptText('')
167
+ } finally {
168
+ setIsLaunching(false)
169
+ }
170
+ }, [promptText, targetId, isDemoMode, onDispatchMission])
171
+
172
+ // Count active running workers
173
+ const activeWorkersCount = useMemo(() => {
174
+ return world.entities.filter((e) => e.status === 'running' || e.status === 'working').length
175
+ }, [world.entities])
176
+
177
+ const pendingApprovalsCount = useMemo(() => {
178
+ return world.entities.filter((e) => e.status === 'awaiting_approval').length
179
+ }, [world.entities])
180
+
181
+ return (
182
+ <div className={`wv-hq-container ${className}`}>
183
+ {/* 1. Header Toolbar */}
184
+ <header className="wv-hq-header">
185
+ <div className="wv-hq-header-left">
186
+ <div className="wv-hq-brand-group">
187
+ <div className="wv-hq-brand-icon">
188
+ <Building2 size={18} />
189
+ </div>
190
+ <div>
191
+ <div className="wv-hq-brand-title-row">
192
+ <h1 className="wv-hq-brand-title">{world.name}</h1>
193
+ <span className="wv-hq-badge">Universal 3D</span>
194
+ </div>
195
+ <p className="wv-hq-brand-desc">Yapay Zeka Destekli Sanal Karargah</p>
196
+ </div>
197
+ </div>
198
+
199
+ <div className="wv-hq-stats-row">
200
+ <span className="wv-hq-stat-pill is-green">
201
+ <span className="wv-hq-pip" />
202
+ {world.entities.length} / 17 Masa Dolu
203
+ </span>
204
+ {activeWorkersCount > 0 && (
205
+ <span className="wv-hq-stat-pill is-purple">
206
+ <Zap size={12} />
207
+ {activeWorkersCount} Görevde
208
+ </span>
209
+ )}
210
+ {pendingApprovalsCount > 0 && (
211
+ <span className="wv-hq-stat-pill is-amber">
212
+ <Clock size={12} />
213
+ {pendingApprovalsCount} Onay Bekliyor
214
+ </span>
215
+ )}
216
+ </div>
217
+ </div>
218
+
219
+ {/* Operational Mode Navigation Tabs */}
220
+ <div className="wv-hq-mode-tabs">
221
+ <button
222
+ type="button"
223
+ onClick={() => setActiveMode('office')}
224
+ className={`wv-hq-mode-tab ${activeMode === 'office' ? 'is-active' : ''}`}
225
+ >
226
+ <Compass size={14} color="#3b82f6" />
227
+ <span>Ofis Katı (3D)</span>
228
+ </button>
229
+
230
+ <button
231
+ type="button"
232
+ onClick={() => setActiveMode('operations')}
233
+ className={`wv-hq-mode-tab ${activeMode === 'operations' ? 'is-active' : ''}`}
234
+ >
235
+ <LayoutDashboard size={14} color="#06b6d4" />
236
+ <span>Operasyonlar</span>
237
+ {projects.length > 0 && (
238
+ <span className="wv-hq-tab-count">{projects.length}</span>
239
+ )}
240
+ </button>
241
+
242
+ <button
243
+ type="button"
244
+ onClick={() => setActiveMode('command_center')}
245
+ className={`wv-hq-mode-tab ${activeMode === 'command_center' ? 'is-active' : ''}`}
246
+ >
247
+ <Terminal size={14} color="#a855f7" />
248
+ <span>AI Komuta Merkezi</span>
249
+ {pendingApprovalsCount > 0 && (
250
+ <span className="wv-hq-tab-badge">{pendingApprovalsCount}</span>
251
+ )}
252
+ </button>
253
+ </div>
254
+
255
+ {/* Header Right Actions */}
256
+ <div className="wv-hq-header-right">
257
+ {onSeedSquad && world.entities.length < 17 && (
258
+ <button
259
+ type="button"
260
+ onClick={onSeedSquad}
261
+ disabled={isSeeding}
262
+ className="wv-hq-action-btn is-seed"
263
+ >
264
+ {isSeeding ? <Loader2 size={13} className="wv-spin" /> : <Sparkles size={13} />}
265
+ <span>Kadro Ekle (17)</span>
266
+ </button>
267
+ )}
268
+
269
+ {activeMode === 'office' && (
270
+ <button
271
+ type="button"
272
+ onClick={handleToggleRoster}
273
+ className={`wv-hq-action-btn ${showRoster ? 'is-active' : ''}`}
274
+ title={showRoster ? 'Kadro Panelini Gizle' : 'Kadro Panelini Aç'}
275
+ >
276
+ {showRoster ? <PanelRightClose size={15} /> : <PanelRightOpen size={15} />}
277
+ <span className="wv-hide-mobile">Kadro Paneli</span>
278
+ </button>
279
+ )}
280
+
281
+ {!standalone ? (
282
+ <a
283
+ href={standaloneUrl}
284
+ target="_blank"
285
+ rel="noreferrer"
286
+ className="wv-hq-action-btn"
287
+ title="Tam Ekran Bağımsız Sayfada Aç"
288
+ >
289
+ <ExternalLink size={14} />
290
+ <span className="wv-hide-mobile">Ayrı Sayfada Aç</span>
291
+ </a>
292
+ ) : (
293
+ <a
294
+ href={returnUrl}
295
+ className="wv-hq-action-btn"
296
+ title="Dashboard'a Dön"
297
+ >
298
+ <ArrowRight size={14} style={{ transform: 'rotate(180deg)' }} />
299
+ <span className="wv-hide-mobile">Dashboard</span>
300
+ </a>
301
+ )}
302
+
303
+ <button
304
+ type="button"
305
+ onClick={handleToggleFullscreen}
306
+ className="wv-hq-icon-btn"
307
+ title={isFullscreen ? 'Tam Ekrandan Çık' : 'Tam Ekran'}
308
+ >
309
+ {isFullscreen ? <Minimize2 size={15} /> : <Maximize2 size={15} />}
310
+ </button>
311
+
312
+ {onRefresh && (
313
+ <button
314
+ type="button"
315
+ onClick={onRefresh}
316
+ disabled={refreshing}
317
+ className="wv-hq-icon-btn"
318
+ title="Verileri Yenile"
319
+ >
320
+ <RefreshCw size={15} className={refreshing ? 'wv-spin' : ''} />
321
+ </button>
322
+ )}
323
+ </div>
324
+ </header>
325
+
326
+ {/* 2. Main Content Viewport */}
327
+ <div className="wv-hq-main-viewport">
328
+ {/* ========================================================== */}
329
+ {/* MODE 1: 3D VIRTUAL WORLD VIEW */}
330
+ {/* ========================================================== */}
331
+ {activeMode === 'office' && (
332
+ <div className="wv-hq-office-layout">
333
+ <div className="wv-hq-canvas-wrapper">
334
+ {loading && (
335
+ <div className="wv-hq-loading-overlay">
336
+ <Loader2 size={32} className="wv-spin" color="#3b82f6" />
337
+ <p>3D Dijital Ofis Katı Yükleniyor...</p>
338
+ </div>
339
+ )}
340
+
341
+ {/* Navigation Hint */}
342
+ <div className="wv-hq-nav-hint">
343
+ <Compass size={14} color="#3b82f6" />
344
+ <span>3D Masaya Tıkla: Bilgiler Açılır • Sol Tık: Çevir • Sağ Tık: Kaydır • Tekerlek: Yakınlaş</span>
345
+ </div>
346
+
347
+ {/* 3D Viewport */}
348
+ <VirtualWorld
349
+ ref={virtualWorldRef}
350
+ world={world}
351
+ preset={preset}
352
+ selectedEntityId={activeEntity?.id}
353
+ onSelectEntity={handleSelect}
354
+ defaultPinMode="pins"
355
+ showControls={true}
356
+ showInspector={false}
357
+ >
358
+ {/* Floating Bottom Command Bar Overlay */}
359
+ <VirtualCommandBar
360
+ presetMissions={presetMissions}
361
+ entities={world.entities}
362
+ targetEntityId={targetId}
363
+ onChangeTarget={setTargetId}
364
+ prompt={promptText}
365
+ onChangePrompt={setPromptText}
366
+ onDispatch={handleDispatch}
367
+ isDemoMode={isDemoMode}
368
+ onToggleDemoMode={() => setIsDemoMode(!isDemoMode)}
369
+ isLaunching={isLaunching}
370
+ />
371
+ </VirtualWorld>
372
+ </div>
373
+
374
+ {/* Collapsible Roster Sidebar */}
375
+ {showRoster && (
376
+ <VirtualRoster
377
+ entities={world.entities}
378
+ departments={departments}
379
+ selectedEntityId={activeEntity?.id}
380
+ onSelectEntity={(id) => {
381
+ const en = world.entities.find((e) => e.id === id) || null
382
+ handleSelect(en)
383
+ }}
384
+ onClose={handleToggleRoster}
385
+ searchQuery={rosterSearch}
386
+ onSearchChange={setRosterSearch}
387
+ selectedCategory={selectedCategory}
388
+ onSelectCategory={setSelectedCategory}
389
+ />
390
+ )}
391
+
392
+ {/* Selected Entity Profile Drawer */}
393
+ {activeEntity && (
394
+ <VirtualEntityDrawer
395
+ entity={activeEntity}
396
+ onClose={() => handleSelect(null)}
397
+ metrics={getEntityMetrics ? getEntityMetrics(activeEntity.id) : undefined}
398
+ latestTask={getEntityLatestTask ? getEntityLatestTask(activeEntity.id) : null}
399
+ onViewReport={() => {
400
+ const task = getEntityLatestTask ? getEntityLatestTask(activeEntity.id) : null
401
+ if (task) {
402
+ setViewingReport({
403
+ prompt: task.prompt,
404
+ summary: task.summary,
405
+ status: task.status,
406
+ })
407
+ }
408
+ }}
409
+ dispatchPrompt={targetId === activeEntity.id ? promptText : ''}
410
+ onChangeDispatchPrompt={(val) => {
411
+ setTargetId(activeEntity.id)
412
+ setPromptText(val)
413
+ }}
414
+ onDispatch={handleDispatch}
415
+ isDispatching={isLaunching}
416
+ />
417
+ )}
418
+ </div>
419
+ )}
420
+
421
+ {/* ========================================================== */}
422
+ {/* MODE 2: OPERATIONS DASHBOARD */}
423
+ {/* ========================================================== */}
424
+ {activeMode === 'operations' && (
425
+ <div className="wv-hq-operations-view">
426
+ {/* Metrics Grid */}
427
+ <div className="wv-hq-ops-metrics-grid">
428
+ <div className="wv-hq-ops-metric-card">
429
+ <div className="wv-ops-metric-header">
430
+ <span>Toplam Proje</span>
431
+ <FolderKanban size={16} color="#3b82f6" />
432
+ </div>
433
+ <div className="wv-ops-metric-num">{projects.length}</div>
434
+ <p className="wv-ops-metric-sub">Aktif iş geliştirme portföyü</p>
435
+ </div>
436
+
437
+ <div className="wv-hq-ops-metric-card">
438
+ <div className="wv-ops-metric-header">
439
+ <span>Departman Sayısı</span>
440
+ <Building2 size={16} color="#06b6d4" />
441
+ </div>
442
+ <div className="wv-ops-metric-num">{departments.length}</div>
443
+ <p className="wv-ops-metric-sub">Fonksiyonel çalışma hücresi</p>
444
+ </div>
445
+
446
+ <div className="wv-hq-ops-metric-card">
447
+ <div className="wv-ops-metric-header">
448
+ <span>Aktif Çalışan</span>
449
+ <Zap size={16} color="#a855f7" />
450
+ </div>
451
+ <div className="wv-ops-metric-num">{activeWorkersCount} / 17</div>
452
+ <p className="wv-ops-metric-sub">Masasında çalışan uzmanlar</p>
453
+ </div>
454
+
455
+ <div className="wv-hq-ops-metric-card">
456
+ <div className="wv-ops-metric-header">
457
+ <span>Onay Bekleyen</span>
458
+ <Clock size={16} color="#f59e0b" />
459
+ </div>
460
+ <div className="wv-ops-metric-num">{pendingApprovalsCount}</div>
461
+ <p className="wv-ops-metric-sub">Yönetici onayı bekleyen görevler</p>
462
+ </div>
463
+ </div>
464
+
465
+ {/* Department Hubs & Activity Timeline */}
466
+ <div className="wv-hq-ops-cols">
467
+ <div className="wv-hq-ops-dept-col">
468
+ <h2 className="wv-hq-section-heading">
469
+ <Building2 size={16} color="#3b82f6" />
470
+ <span>Departman Odaları & Masaları</span>
471
+ </h2>
472
+
473
+ <div className="wv-hq-dept-cards-grid">
474
+ {departments.map((dept) => {
475
+ const deptEntities = world.entities.filter((e) => dept.slotIds.includes(e.id))
476
+ const isDeptBusy = deptEntities.some((e) => e.status === 'running' || e.status === 'working')
477
+
478
+ return (
479
+ <div key={dept.id} className="wv-hq-dept-card">
480
+ <div>
481
+ <div className="wv-dept-card-top">
482
+ <span className="wv-dept-color-pip" style={{ backgroundColor: dept.color }} />
483
+ {isDeptBusy && <span className="wv-dept-busy-badge">⚡ Çalışıyor</span>}
484
+ </div>
485
+ <h3 className="wv-dept-name">{dept.name}</h3>
486
+ <p className="wv-dept-desc">{dept.description}</p>
487
+ </div>
488
+
489
+ <div className="wv-dept-card-bottom">
490
+ <span>{deptEntities.length} Masa</span>
491
+ <button
492
+ type="button"
493
+ onClick={() => {
494
+ setSelectedCategory(dept.slug)
495
+ setActiveMode('office')
496
+ }}
497
+ className="wv-dept-link-btn"
498
+ >
499
+ <span>Odaya Git</span>
500
+ <ArrowRight size={13} />
501
+ </button>
502
+ </div>
503
+ </div>
504
+ )
505
+ })}
506
+ </div>
507
+ </div>
508
+
509
+ {/* Activity Timeline */}
510
+ <div className="wv-hq-ops-act-col">
511
+ <h2 className="wv-hq-section-heading">
512
+ <Activity size={16} color="#3b82f6" />
513
+ <span>Sistem Aktivite Akışı</span>
514
+ </h2>
515
+
516
+ <div className="wv-hq-act-box">
517
+ {activities.length === 0 ? (
518
+ <div className="wv-hq-empty-act">
519
+ <Clock size={24} style={{ opacity: 0.4, margin: '0 auto 8px' }} />
520
+ <p>Kayıtlı sistem aktivitesi bulunmuyor.</p>
521
+ </div>
522
+ ) : (
523
+ activities.slice(0, 8).map((act) => (
524
+ <div key={act.id} className="wv-hq-act-item">
525
+ <span className="wv-act-pip" />
526
+ <div className="wv-act-content">
527
+ <p className="wv-act-title">{act.title}</p>
528
+ {act.description && <p className="wv-act-desc">{act.description}</p>}
529
+ <span className="wv-act-time">
530
+ {new Date(act.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
531
+ </span>
532
+ </div>
533
+ </div>
534
+ ))
535
+ )}
536
+ </div>
537
+ </div>
538
+ </div>
539
+ </div>
540
+ )}
541
+
542
+ {/* ========================================================== */}
543
+ {/* MODE 3: AI COMMAND CENTER */}
544
+ {/* ========================================================== */}
545
+ {activeMode === 'command_center' && (
546
+ <div className="wv-hq-command-view">
547
+ <div className="wv-hq-command-center-box">
548
+ {/* Mission Header Card */}
549
+ <div className="wv-hq-dispatch-card">
550
+ <div className="wv-dispatch-header-row">
551
+ <div className="wv-dispatch-icon-badge">
552
+ <Terminal size={20} />
553
+ </div>
554
+ <div>
555
+ <h2 className="wv-dispatch-title">Yapay Zeka Komuta ve Orkestrasyon</h2>
556
+ <p className="wv-dispatch-sub">
557
+ Genel Müdürlük üzerinden tüm departman çalışanlarına otomatik görev dağıtımı yapın.
558
+ </p>
559
+ </div>
560
+ </div>
561
+
562
+ <div className="wv-dispatch-input-area">
563
+ <textarea
564
+ value={promptText}
565
+ onChange={(e) => setPromptText(e.target.value)}
566
+ rows={3}
567
+ placeholder="Şirket hedefinizi veya karmaşık projenizi yazın... (Örn: Yeni dijital pazarlama kampanyası için strateji, görsel briefler ve bütçe planını oluştur)"
568
+ className="wv-dispatch-textarea"
569
+ />
570
+ <div className="wv-dispatch-actions-row">
571
+ <button
572
+ type="button"
573
+ onClick={() => setIsDemoMode(!isDemoMode)}
574
+ className={`wv-demo-toggle-btn ${isDemoMode ? 'is-demo' : 'is-ai'}`}
575
+ >
576
+ {isDemoMode ? <Sparkles size={14} /> : <Bot size={14} />}
577
+ <span>{isDemoMode ? 'Demo Hızlı Simülasyon' : 'Gerçek LLM API'}</span>
578
+ </button>
579
+
580
+ <button
581
+ type="button"
582
+ onClick={handleDispatch}
583
+ disabled={isLaunching || !promptText.trim()}
584
+ className="wv-dispatch-submit-big-btn"
585
+ >
586
+ {isLaunching ? <Loader2 size={16} className="wv-spin" /> : <Send size={15} />}
587
+ <span>Orkestrasyonu Başlat</span>
588
+ </button>
589
+ </div>
590
+ </div>
591
+ </div>
592
+
593
+ {/* Tasks Review Feed */}
594
+ <div className="wv-hq-review-section">
595
+ <h3 className="wv-hq-section-heading">
596
+ <Clock size={16} color="#f59e0b" />
597
+ <span>Onay ve Denetim Bekleyen Görevler</span>
598
+ </h3>
599
+
600
+ <div className="wv-hq-review-feed">
601
+ {world.entities.filter((e) => getEntityLatestTask && getEntityLatestTask(e.id)).length === 0 ? (
602
+ <div className="wv-hq-empty-feed">
603
+ Henüz tamamlanan veya onay bekleyen bir görev bulunmuyor.
604
+ </div>
605
+ ) : (
606
+ world.entities
607
+ .filter((e) => getEntityLatestTask && getEntityLatestTask(e.id))
608
+ .map((entity) => {
609
+ const task = getEntityLatestTask!(entity.id)!
610
+ return (
611
+ <div key={entity.id} className="wv-hq-review-card">
612
+ <div className="wv-review-info">
613
+ <div className="wv-review-name-row">
614
+ <span className="wv-review-entity-name">
615
+ #{entity.pinNumber || '•'} {entity.name}
616
+ </span>
617
+ <span className={`wv-drawer-status-chip ${task.status === 'running' ? 'is-running' : 'is-idle'}`}>
618
+ {task.status || entity.status}
619
+ </span>
620
+ </div>
621
+ <p className="wv-review-prompt">{task.prompt}</p>
622
+ </div>
623
+
624
+ <button
625
+ type="button"
626
+ onClick={() => {
627
+ setViewingReport({
628
+ prompt: task.prompt,
629
+ summary: task.summary,
630
+ status: task.status,
631
+ })
632
+ }}
633
+ className="wv-review-view-btn"
634
+ >
635
+ <Eye size={14} />
636
+ <span>Raporu Gör</span>
637
+ </button>
638
+ </div>
639
+ )
640
+ })
641
+ )}
642
+ </div>
643
+ </div>
644
+ </div>
645
+ </div>
646
+ )}
647
+ </div>
648
+
649
+ {/* 3. Report Modal */}
650
+ {viewingReport && (
651
+ <VirtualReportModal
652
+ report={viewingReport}
653
+ onClose={() => setViewingReport(null)}
654
+ />
655
+ )}
656
+ </div>
657
+ )
658
+ }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, useEffect } from 'react'
2
- import { X, Focus, Play, CheckCircle2, AlertCircle, Clock, ChevronRight } from 'lucide-react'
2
+ import { X, Focus } from 'lucide-react'
3
3
  import type { WorldEntity } from '../core/types'
4
4
 
5
5
  export interface EntityInspectorProps {
@@ -27,7 +27,6 @@ export function EntityInspector({
27
27
 
28
28
  if (!entity) return null
29
29
 
30
- const isPerson = entity.type === 'person' || entity.type === 'actor'
31
30
  const isRunning = entity.status === 'running' || entity.status === 'working'
32
31
 
33
32
  return (
@@ -1,4 +1,4 @@
1
- import { type ReactNode, useEffect, useRef } from 'react'
1
+ import type { ReactNode } from 'react'
2
2
  import type { WorldEntity, PinDisplayMode } from '../core/types'
3
3
 
4
4
  export interface EntityPinsProps {