fix(know-your-world): fix TypeScript build errors

- Fix MapData import in GameInfoPanel.tsx (import from types, not maps)
- Fix MapData import in test files
- Fix currentRegionName type (handle undefined with ?? null)

These errors were blocking the Docker build in CI.
This commit is contained in:
Thomas Hallock 2025-11-23 08:33:44 -06:00
parent e0328fcbcc
commit f622bfab54
4 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { GameInfoPanel } from './GameInfoPanel'
import type { MapData } from '../maps'
import type { MapData } from '../types'
// Mock the context
vi.mock('@/contexts/ThemeContext', () => ({

View File

@ -4,7 +4,7 @@ import { useEffect } from 'react'
import { css } from '@styled/css'
import { useTheme } from '@/contexts/ThemeContext'
import { useKnowYourWorld } from '../Provider'
import type { MapData } from '../maps'
import type { MapData } from '../types'
interface GameInfoPanelProps {
mapData: MapData

View File

@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { render, screen } from '@testing-library/react'
import { PlayingPhase } from './PlayingPhase'
import type { MapData } from '../maps'
import type { MapData } from '../types'
// Mock dependencies
vi.mock('../Provider', () => ({

View File

@ -21,7 +21,7 @@ export function PlayingPhase() {
// Get the display name for the current prompt
const currentRegionName = state.currentPrompt
? mapData.regions.find((r) => r.id === state.currentPrompt)?.name
? mapData.regions.find((r) => r.id === state.currentPrompt)?.name ?? null
: null
// Debug logging