Fix WordDetailModal: Complete localhost:3000 hardcoding cleanup

- Fixed API_URL in WordDetailModal.tsx to use explicit undefined check
- This completes the Docker deployment fix for all frontend components
- Word info modal now works correctly in Docker via nginx proxy
- All 4 locations now use consistent environment-aware URL pattern:
  * api.ts (API client)
  * videoPlaylist.ts (video URLs)
  * VideoUpload.tsx (admin video upload)
  * WordDetailModal.tsx (word info modal)

Fixes: Word info click feature in Docker deployment

Co-Authored-By: Auggie
This commit is contained in:
2026-01-18 17:32:55 +01:00
parent 030491fc5a
commit 1cff7740a8

View File

@@ -57,7 +57,7 @@ export function WordDetailModal({ term, open, onClose, onAddToSentence }: WordDe
const imageMedia = term.media?.find(m => m.kind === 'IMAGE' || m.kind === 'ILLUSTRATION'); const imageMedia = term.media?.find(m => m.kind === 'IMAGE' || m.kind === 'ILLUSTRATION');
// Construct full video URL // Construct full video URL
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3000'; const API_URL = import.meta.env.VITE_API_URL !== undefined ? import.meta.env.VITE_API_URL : 'http://localhost:3000';
const videoUrl = videoMedia?.url.startsWith('http') const videoUrl = videoMedia?.url.startsWith('http')
? videoMedia.url ? videoMedia.url
: `${API_URL}${videoMedia?.url}`; : `${API_URL}${videoMedia?.url}`;