import { useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router'; import { TopBar } from '../components/ui'; import { loadGameUI } from '../games/registry'; import type { GameUI } from '../games/types'; import { GameNotice, gameName } from '../components/GameNotice'; import { QuickStartButton } from '../components/GameHelp'; export default function RulesPage() { const { gameId = '' } = useParams(); const nav = useNavigate(); const [ui, setUi] = useState(undefined); useEffect(() => { loadGameUI(gameId).then(setUi); }, [gameId]); const g = { nameKo: gameName(gameId) }; return ( <> nav(-1)} width="narrow" />
{ui && } {ui === undefined ?

불러오는 중…

: ui ? :

아직 준비 중인 게임이에요.

}
); }