File size: 22,342 Bytes
6a03d7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01a52f1
6a03d7f
 
 
 
01a52f1
6a03d7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01a52f1
6a03d7f
 
 
 
 
 
 
 
01a52f1
6a03d7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
import React, { useState, useRef, useEffect } from 'react'
import { useNexusStore } from '../store/nexusStore'
import type { Track } from '../types/audio'

interface AudioControls {
  loadTrack: (track: Track) => Promise<void>
  play: () => Promise<void>
  pause: () => void
  seekTo: (time: number) => void
  setVolume: (volume: number) => void
  getAudioElement?: () => HTMLAudioElement | null
  getCurrentTime?: () => number
  testAudioPlayback?: (url: string) => Promise<boolean>
}

interface ControlPlinthProps {
  tracks: Track[]
  audioControls: AudioControls
}

const ControlPlinth: React.FC<ControlPlinthProps> = ({ tracks, audioControls }) => {
  const [isTestingAudio, setIsTestingAudio] = useState(false)
  const [isDockCollapsed, setIsDockCollapsed] = useState(false)
  const timelineRef = useRef<HTMLDivElement>(null)
  
  const {
    playback,
    autoPlayEnabled,
    setIsPlaying,
    setCurrentTrack,
    setVolume,
    setCurrentTime,
    setAutoPlayEnabled,
    getNextTrack,
    getPreviousTrack
  } = useNexusStore()

  // Load initial track (auto-start is now handled by LivingNexusApp)
  useEffect(() => {
    const loadInitialTrack = async () => {
      if (tracks.length > 0 && !playback.currentTrack) {
        try {
          console.log('Loading initial track for controls:', tracks[0].title)
          
          // Test basic audio playback first
          if (audioControls.testAudioPlayback) {
            setIsTestingAudio(true)
            console.log('🧪 Running audio test...')
            const canPlay = await audioControls.testAudioPlayback(tracks[0].url)
            setIsTestingAudio(false)
            
            if (!canPlay) {
              console.error('❌ Basic audio test failed - audio may not work')
              return
            }
            console.log('✅ Basic audio test passed')
          }
          
          setCurrentTrack(tracks[0])
          await audioControls.loadTrack(tracks[0])
          console.log('Initial track loaded successfully (auto-start handled by main app)')
        } catch (error) {
          console.error('Failed to load initial track:', error)
          setIsTestingAudio(false)
        }
      }
    }

    loadInitialTrack()
  }, [tracks, playback.currentTrack, setCurrentTrack, audioControls, setIsTestingAudio])

  const handlePlayPause = async () => {
    if (!playback.currentTrack) {
      console.log('No track selected, cannot play')
      return
    }

    if (isTestingAudio) {
      console.log('Audio test in progress, please wait...')
      return
    }

    try {
      if (playback.isPlaying) {
        audioControls.pause()
        setIsPlaying(false)
      } else {
        // Ensure track is loaded before playing
        console.log('Starting playback for:', playback.currentTrack.title)
        await audioControls.play()
        setIsPlaying(true)
      }
    } catch (error) {
      console.error('Playback control failed:', error)
      setIsPlaying(false)
    }
  }

  const handleTrackSelect = async (track: Track) => {
    console.log('Selecting track:', track.title)
    
    try {
      // Pause current track if playing
      if (playback.isPlaying) {
        audioControls.pause()
        setIsPlaying(false)
      }

      // Update UI immediately
      setCurrentTrack(track)

      // Load the new track
      console.log('Loading track:', track.title)
      await audioControls.loadTrack(track)
      console.log('Track loaded, starting playback')
      
      // Start playback
      await audioControls.play()
      setIsPlaying(true)
    } catch (error) {
      console.error('Track selection failed:', error)
      setIsPlaying(false)
    }
  }

  const handlePrevious = async () => {
    const previousTrack = getPreviousTrack()
    if (previousTrack) {
      await handleTrackSelect(previousTrack)
    }
  }

  const handleNext = async () => {
    const nextTrack = getNextTrack()
    if (nextTrack) {
      await handleTrackSelect(nextTrack)
    }
  }

  const handleTimelineClick = (e: React.MouseEvent<HTMLDivElement>) => {
    if (!timelineRef.current || !playback.currentTrack) return

    const rect = timelineRef.current.getBoundingClientRect()
    const clickX = e.clientX - rect.left
    const percentage = clickX / rect.width
    
    // Get actual duration from audio controls
    const audioElement = audioControls.getAudioElement?.()
    const duration = audioElement?.duration || 0
    
    if (duration > 0) {
      const newTime = percentage * duration
      audioControls.seekTo(newTime)
      setCurrentTime(newTime)
    }
  }

  const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const volume = parseFloat(e.target.value)
    setVolume(volume)
    audioControls.setVolume(volume)
  }

  const formatTime = (seconds: number): string => {
    const mins = Math.floor(seconds / 60)
    const secs = Math.floor(seconds % 60)
    return `${mins}:${secs.toString().padStart(2, '0')}`
  }

  const getPlayPauseGlyph = () => {
    return playback.isPlaying ? '‖' : '▷'
  }

  const getCurrentProgress = (): number => {
    // Get actual duration and current time
    const audioElement = audioControls.getAudioElement?.()
    const duration = audioElement?.duration || 0
    const currentTime = audioControls.getCurrentTime?.() || playback.currentTime
    
    return duration > 0 ? (currentTime / duration) * 100 : 0
  }

  const getCurrentDuration = (): number => {
    const audioElement = audioControls.getAudioElement?.()
    return audioElement?.duration || 0
  }

  return (
    <div 
      className="control-plinth-dock" 
      style={{
        position: 'fixed',
        top: 0,
        left: 0,
        bottom: 0,
        width: isDockCollapsed ? '50px' : '380px',
        background: 'rgba(0, 0, 0, 0.95)',
        border: '1px solid rgba(255, 215, 0, 0.3)',
        borderLeft: 'none',
        borderTopRightRadius: '8px',
        borderBottomRightRadius: '8px',
        backdropFilter: 'blur(15px)',
        transition: 'all 0.3s ease-in-out',
        zIndex: 1000,
        display: 'flex',
        flexDirection: 'column',
        overflow: 'visible',
        pointerEvents: 'auto'
      }}
      onMouseEnter={() => {
        // Disable camera controls when mouse enters audio dock
        const event = new CustomEvent('disableCameraControls', { detail: true })
        window.dispatchEvent(event)
      }}
      onMouseLeave={() => {
        // Re-enable camera controls when mouse leaves audio dock
        const event = new CustomEvent('disableCameraControls', { detail: false })
        window.dispatchEvent(event)
      }}
    >
      {/* Dock Toggle Tab - Prominent and Always Visible */}
      <div
        style={{
          position: 'absolute',
          right: '-45px',
          top: '50%',
          transform: 'translateY(-50%)',
          zIndex: 1003
        }}
      >
        <button
          onClick={() => setIsDockCollapsed(!isDockCollapsed)}
          onMouseEnter={(e) => {
            e.currentTarget.style.transform = 'scale(1.1)'
            e.currentTarget.style.backgroundColor = 'rgba(255, 215, 0, 0.4)'
            e.currentTarget.style.boxShadow = '0 0 20px rgba(255, 215, 0, 0.8)'
          }}
          onMouseLeave={(e) => {
            e.currentTarget.style.transform = 'scale(1)'
            e.currentTarget.style.backgroundColor = 'rgba(0, 0, 0, 0.95)'
            e.currentTarget.style.boxShadow = '2px 0 15px rgba(0, 0, 0, 0.7)'
          }}
          style={{
            background: 'rgba(0, 0, 0, 0.95)',
            border: '3px solid rgba(255, 215, 0, 0.6)',
            borderRadius: '0 15px 15px 0',
            borderLeft: 'none',
            width: '45px',
            height: '90px',
            color: '#FFD700',
            cursor: 'pointer',
            fontSize: '22px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            backdropFilter: 'blur(15px)',
            transition: 'all 0.3s ease-in-out',
            boxShadow: '2px 0 15px rgba(0, 0, 0, 0.7)',
            fontWeight: 'bold',
            outline: 'none'
          }}
          title={isDockCollapsed ? 'Expand Audio Player' : 'Collapse Audio Player'}
        >
          <div style={{
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
            gap: '2px'
          }}>
            <div style={{ fontSize: '18px' }}>{isDockCollapsed ? '▶' : '◀'}</div>
            <div style={{ 
              fontSize: '8px', 
              opacity: 0.8,
              writingMode: 'vertical-rl',
              textOrientation: 'mixed',
              letterSpacing: '1px'
            }}>
              {isDockCollapsed ? 'EXPAND' : 'HIDE'}
            </div>
          </div>
        </button>
      </div>

      {/* Collapsed State - Enhanced with Progress */}
      {isDockCollapsed && (
        <div style={{
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'center',
          padding: '20px 10px',
          gap: '15px',
          height: '100%',
          justifyContent: 'center',
          position: 'relative'
        }}>
          {/* Vertical Progress Indicator */}
          <div style={{
            position: 'absolute',
            left: '5px',
            top: '20px',
            bottom: '20px',
            width: '3px',
            background: 'rgba(255, 215, 0, 0.3)',
            borderRadius: '2px'
          }}>
            <div style={{
              position: 'absolute',
              bottom: 0,
              width: '100%',
              height: `${getCurrentProgress()}%`,
              background: 'linear-gradient(to top, #FFD700, #FF6B35)',
              borderRadius: '2px',
              transition: 'height 0.1s ease'
            }} />
          </div>

          <button 
            className="central-glyph"
            onClick={handlePlayPause}
            disabled={!playback.currentTrack}
            style={{
              width: '40px',
              height: '40px',
              fontSize: '16px',
              animation: playback.isPlaying ? 'glyphPulse 2s ease-in-out infinite' : 'none'
            }}
          >
            {getPlayPauseGlyph()}
          </button>
          
          {/* Volume Indicator */}
          <div style={{
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
            gap: '5px'
          }}>
            <div style={{
              fontSize: '8px',
              color: '#8B6914'
            }}>
              🔊
            </div>
            <div style={{
              width: '2px',
              height: '30px',
              background: 'rgba(255, 215, 0, 0.3)',
              borderRadius: '1px',
              position: 'relative'
            }}>
              <div style={{
                position: 'absolute',
                bottom: 0,
                width: '100%',
                height: `${playback.volume * 100}%`,
                background: '#FFD700',
                borderRadius: '1px',
                transition: 'height 0.2s ease'
              }} />
            </div>
          </div>
          
          <div style={{
            writingMode: 'vertical-rl',
            textOrientation: 'mixed',
            fontSize: '9px',
            color: '#FFD700',
            textAlign: 'center',
            maxHeight: '150px',
            overflow: 'hidden',
            lineHeight: '1.2'
          }}>
            {playback.currentTrack?.title || 'No Track'}
          </div>

          {/* Track Position Indicator with Auto-play Status */}
          {playback.currentTrack && (
            <div style={{
              fontSize: '8px',
              color: '#8B6914',
              textAlign: 'center',
              transform: 'rotate(-90deg)',
              whiteSpace: 'nowrap',
              display: 'flex',
              flexDirection: 'column',
              alignItems: 'center',
              gap: '4px'
            }}>
              <div>{tracks.findIndex(t => t.id === playback.currentTrack?.id) + 1}/{tracks.length}</div>
              {autoPlayEnabled && (
                <div style={{ 
                  fontSize: '6px', 
                  color: '#FFD700',
                  opacity: 0.8
                }}>
                  AUTO
                </div>
              )}
            </div>
          )}
        </div>
      )}

      {/* Expanded State - Full Controls */}
      {!isDockCollapsed && (
        <div style={{
          display: 'flex',
          flexDirection: 'column',
          height: '100%',
          padding: '20px',
          gap: '15px'
        }}>
          {/* Track Information Display */}
          <div className="track-info" style={{
            textAlign: 'center',
            borderBottom: '1px solid rgba(255, 215, 0, 0.2)',
            paddingBottom: '15px'
          }}>
            <div className="track-title" style={{
              fontSize: '16px',
              fontWeight: 600,
              color: '#FFD700',
              marginBottom: '4px'
            }}>
              {playback.currentTrack?.title || 'Select Track'}
            </div>
            <div className="track-artist" style={{
              fontSize: '12px',
              color: '#8B6914'
            }}>
              {playback.currentTrack?.artist || ''}
            </div>
          </div>

          {/* Main Controls */}
          <div style={{
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
            gap: '15px'
          }}>
            {/* Transport Controls */}
            <div style={{
              display: 'flex',
              alignItems: 'center',
              gap: '10px'
            }}>
              <button 
                className="plinth-control"
                onClick={handlePrevious}
                disabled={!playback.currentTrack}
                style={{
                  padding: '8px',
                  fontSize: '14px'
                }}
              >

              </button>

              <button 
                className="central-glyph"
                onClick={handlePlayPause}
                disabled={!playback.currentTrack}
                style={{
                  width: '50px',
                  height: '50px',
                  fontSize: '20px'
                }}
              >
                {getPlayPauseGlyph()}
              </button>

              <button 
                className="plinth-control"
                onClick={handleNext}
                disabled={!playback.currentTrack}
                style={{
                  padding: '8px',
                  fontSize: '14px'
                }}
              >

              </button>
            </div>

            {/* Timeline Scrubber */}
            <div style={{ width: '100%' }}>
              <div 
                ref={timelineRef}
                className="timeline-channel"
                onClick={handleTimelineClick}
                style={{
                  width: '100%',
                  height: '8px',
                  margin: '0'
                }}
              >
                <div 
                  className="timeline-indicator"
                  style={{ width: `${getCurrentProgress()}%` }}
                />
              </div>
              
              {/* Time Display */}
              <div className="time-display" style={{
                display: 'flex',
                justifyContent: 'space-between',
                gap: '8px',
                fontSize: '10px',
                color: '#8B6914',
                marginTop: '5px'
              }}>
                <span>{formatTime(audioControls.getCurrentTime?.() || playback.currentTime)}</span>
                <span>{formatTime(getCurrentDuration())}</span>
              </div>
            </div>

            {/* Volume Control */}
            <div className="volume-control" style={{
              display: 'flex',
              flexDirection: 'column',
              alignItems: 'center',
              gap: '8px',
              width: '100%'
            }}>
              <label style={{ fontSize: '12px', color: '#FFD700' }}>Volume</label>
              <input
                type="range"
                min="0"
                max="1"
                step="0.05"
                value={playback.volume}
                onChange={handleVolumeChange}
                className="volume-slider"
                style={{ width: '100%' }}
              />
            </div>

            {/* Auto-play Control */}
            <div className="autoplay-control" style={{
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
              gap: '8px',
              width: '100%',
              padding: '8px',
              background: 'rgba(255, 215, 0, 0.1)',
              border: '1px solid rgba(255, 215, 0, 0.3)',
              borderRadius: '6px'
            }}>
              <label style={{ 
                fontSize: '12px', 
                color: '#FFD700',
                cursor: 'pointer',
                display: 'flex',
                alignItems: 'center',
                gap: '6px'
              }}>
                <input
                  type="checkbox"
                  checked={autoPlayEnabled}
                  onChange={(e) => setAutoPlayEnabled(e.target.checked)}
                  style={{
                    transform: 'scale(1.2)',
                    accentColor: '#FFD700'
                  }}
                />
                Auto-play Album
              </label>
            </div>
          </div>

          {/* Track List - Extended Vertically */}
          <div className="track-list-tablet" style={{
            flex: 1,
            background: 'rgba(0, 0, 0, 0.5)',
            border: '1px solid rgba(255, 215, 0, 0.2)',
            borderRadius: '6px',
            padding: '15px',
            marginTop: '15px',
            overflow: 'hidden',
            display: 'flex',
            flexDirection: 'column',
            minHeight: '300px', // Ensure minimum height for better track visibility
            maxHeight: 'calc(100vh - 280px)' // Allow it to grow but leave space for controls
          }}>
            <div className="tablet-header" style={{
              textAlign: 'center',
              marginBottom: '10px',
              paddingBottom: '8px',
              borderBottom: '1px solid rgba(255, 215, 0, 0.3)'
            }}>
              <h3 style={{
                margin: 0,
                color: '#FFD700',
                fontSize: '12px'
              }}>Album Tracks</h3>
            </div>
            
            <div className="track-list" style={{
              display: 'flex',
              flexDirection: 'column',
              gap: '8px',
              overflowY: 'auto',
              overflowX: 'hidden',
              flex: 1,
              paddingRight: '8px' // Add padding for scrollbar
            }}>
              {tracks.map((track, index) => (
                <div
                  key={track.id}
                  className={`track-item ${
                    playback.currentTrack?.id === track.id ? 'active' : ''
                  }`}
                  onClick={() => handleTrackSelect(track)}
                  style={{
                    display: 'flex',
                    alignItems: 'center',
                    gap: '8px',
                    padding: '10px 8px',
                    borderRadius: '6px',
                    cursor: 'pointer',
                    transition: 'all 0.2s ease',
                    border: '1px solid transparent',
                    background: playback.currentTrack?.id === track.id 
                      ? 'linear-gradient(45deg, rgba(255, 215, 0, 0.2), rgba(139, 105, 20, 0.3))' 
                      : 'transparent',
                    borderColor: playback.currentTrack?.id === track.id ? 'rgba(255, 215, 0, 0.4)' : 'transparent'
                  }}
                  onMouseEnter={(e) => {
                    if (playback.currentTrack?.id !== track.id) {
                      e.currentTarget.style.background = 'rgba(255, 215, 0, 0.1)'
                      e.currentTarget.style.borderColor = 'rgba(255, 215, 0, 0.2)'
                    }
                  }}
                  onMouseLeave={(e) => {
                    if (playback.currentTrack?.id !== track.id) {
                      e.currentTarget.style.background = 'transparent'
                      e.currentTarget.style.borderColor = 'transparent'
                    }
                  }}
                >
                                     <span className="track-number" style={{
                     fontSize: '10px',
                     color: playback.currentTrack?.id === track.id ? '#FFD700' : '#8B6914',
                     minWidth: '20px',
                     fontWeight: playback.currentTrack?.id === track.id ? 'bold' : 'normal'
                   }}>
                     {playback.currentTrack?.id === track.id && playback.isPlaying ? '◈' : (index + 1)}
                   </span>
                                     <div className="track-details" style={{ 
                     flex: 1, 
                     overflow: 'hidden',
                     paddingRight: '5px'
                   }}>
                     <div className="track-name" style={{
                       fontSize: '12px',
                       color: playback.currentTrack?.id === track.id ? '#FFD700' : '#F5E6D3',
                       marginBottom: '2px',
                       whiteSpace: 'nowrap',
                       overflow: 'hidden',
                       textOverflow: 'ellipsis',
                       fontWeight: playback.currentTrack?.id === track.id ? 'bold' : 'normal'
                     }}>{track.title}</div>
                     <div className="track-artist" style={{
                       fontSize: '9px',
                       color: '#8B6914',
                       opacity: 0.8
                     }}>{track.artist}</div>
                   </div>
                </div>
              ))}
            </div>
          </div>
        </div>
      )}
    </div>
  )
}

export default ControlPlinth