import { useEffect } from 'react' import { getBackgroundImage, getStaticImage } from '@/lib/utils' import { useNavigate, useParams } from 'react-router-dom' import { Image } from '@/components' import { usePuzzleStore } from '@/store/puzzleStore' import { getResidenceStageUnlocks, isResidenceUnlocked } from '@/config/progression' import { useMaozedongStore } from '@/store/maozedongStore' const Maozedong = () => { const navigate = useNavigate() const { moduleName } = useParams<{ moduleName: string }>() // starName 固定为 maozedong const starName = 'maozedong' const lastVisitedPlace = useMaozedongStore((state) => state.lastVisitedPlace) const puzzles = usePuzzleStore((state) => state.puzzles) const isLoaded = usePuzzleStore((state) => state.isLoaded) const { dialogueUnlocked, reflectionUnlocked, internalizationUnlocked } = getResidenceStageUnlocks(starName, puzzles) useEffect(() => { if (isLoaded && !isResidenceUnlocked(starName, puzzles)) { navigate('/menu', { replace: true }) } }, [isLoaded, navigate, puzzles, starName]) if (!moduleName) return null return (