fix(frontend/story-integration): Fix TypeScript type imports and duplicate dictionary key

- Added 'import type' syntax for TypeScript type-only imports
- Removed duplicate 'ein' entry in GERMAN_WORD_DICTIONARY
- Removed unused import in StoryPlayer component
- Verified build passes successfully

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Lasse Rune Hansen 2026-06-13 16:25:17 +02:00
parent 81a9eff5bc
commit 17ce0d1eb8
6 changed files with 65 additions and 9 deletions

View file

@ -9,7 +9,8 @@
"version": "0.0.0",
"dependencies": {
"react": "^19.2.6",
"react-dom": "^19.2.6"
"react-dom": "^19.2.6",
"react-router-dom": "^7.0.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
@ -1324,6 +1325,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/cookie": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@ -2397,6 +2411,44 @@
"react": "^19.2.6"
}
},
"node_modules/react-router": {
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.17.0.tgz",
"integrity": "sha512-FDELK7rTMlCHO5+reyXsPlmfr7N1F91lPHsWYfMEGQm/KQ+F4JFM8jGoeQDmDvdTs93Fw9aSilH+uKRb4/jXvQ==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
"set-cookie-parser": "^2.6.0"
},
"engines": {
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
}
}
},
"node_modules/react-router-dom": {
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.17.0.tgz",
"integrity": "sha512-fyU2yjGups/hE6Xz0I5ZYbVL8Gx29eCjgpHaRaTaVU+OOAdfRX05KsvyRm0GO8YQwOkhpU3MurW1jyMUJn+zSw==",
"license": "MIT",
"dependencies": {
"react-router": "7.17.0"
},
"engines": {
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
}
},
"node_modules/rolldown": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.2.tgz",
@ -2447,6 +2499,12 @@
"semver": "bin/semver.js"
}
},
"node_modules/set-cookie-parser": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
"integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
"license": "MIT"
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",

View file

@ -1,6 +1,5 @@
import { useState, useRef, useEffect, useCallback } from 'react';
import { StorySegmentDto } from '../../../types/api/story';
import { storyApi } from '../../../lib/api/story';
import type { StorySegmentDto } from '../../../types/api/story';
interface StoryPlayerProps {
segment: StorySegmentDto;

View file

@ -1,6 +1,6 @@
import { useState, useCallback } from 'react';
import { StorySegmentDto } from '../../../types/api/story';
import { WordTranslation } from '../../../types/api/story';
import type { StorySegmentDto } from '../../../types/api/story';
import type { WordTranslation } from '../../../types/api/story';
// Simple German word dictionary for common words
// In production, this should come from an API
@ -11,7 +11,6 @@ const GERMAN_WORD_DICTIONARY: Record<string, WordTranslation> = {
das: { word: 'das', translation: 'the', partOfSpeech: 'article', gender: 'neuter' },
ein: { word: 'ein', translation: 'a/an', partOfSpeech: 'article', gender: 'masculine' },
eine: { word: 'eine', translation: 'a/an', partOfSpeech: 'article', gender: 'feminine' },
ein: { word: 'ein', translation: 'a/an', partOfSpeech: 'article' },
// Pronouns
ich: { word: 'ich', translation: 'I', partOfSpeech: 'pronoun' },

View file

@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react';
import { StoryProgressDto, StorySegmentProgressDto } from '../../../types/api/story';
import type { StoryProgressDto, StorySegmentProgressDto } from '../../../types/api/story';
import { storyApi } from '../../../lib/api/story';
interface StoryTabProps {

View file

@ -1,4 +1,4 @@
import {
import type {
StorySegmentDto,
CreateStorySegmentDto,
UpdateStorySegmentDto,

View file

@ -1,6 +1,6 @@
import { useState, useEffect, useCallback } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { StorySegmentDto, LevelWithStoriesDto } from '../types/api/story';
import type { StorySegmentDto, LevelWithStoriesDto } from '../types/api/story';
import { storyApi } from '../lib/api/story';
import StorySegment from '../components/features/story/StorySegment';
import StoryPlayer from '../components/features/story/StoryPlayer';