diff --git a/src/pages/playRoom/component/waitingStart/index.tsx b/src/pages/playRoom/component/waitingStart/index.tsx index 1fa389f..a17fc9f 100644 --- a/src/pages/playRoom/component/waitingStart/index.tsx +++ b/src/pages/playRoom/component/waitingStart/index.tsx @@ -1,7 +1,19 @@ +import { emitSocket } from '@/utils/api.js'; import { Button, Space } from 'antd'; import { startGame } from '../../api.js'; +import { RoomInfo } from '../../type.js'; -export default function WaitingStart ({ isButtonPosition, hasOtherPlayers }: { isButtonPosition: boolean, hasOtherPlayers: number }) { +export default function WaitingStart ({ isButtonPosition, hasOtherPlayers, room }: { isButtonPosition: boolean; hasOtherPlayers: number; room: RoomInfo}) { + if (room.statu === 'started') { + return <>; + } else if (room.statu === 'settling') { + return isButtonPosition + ? + : ; + } + return isButtonPosition && hasOtherPlayers ?