import { useEffect } from 'react' import { getBackgroundImage, getStaticImage } from '@/lib/utils' import { Image } from '@/components' import { usePuzzleStore } from '@/store/puzzleStore' import { getResidenceStageUnlocks, isResidenceUnlocked } from '@/config/progression' import { useNavigate, useParams } from 'react-router-dom' import { useRongdeshengStore } from '@/store/rongdeshengStore' const RongdeshengHome = () => { const navigate = useNavigate() const { moduleName } = useParams<{ moduleName: string }>() // starName 固定为 rongdesheng const starName = 'rongdesheng' const lastVisitedPlace = useRongdeshengStore((s) => s.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 (