"use client";

import { useTranslation } from "react-i18next";

import { HallBettingGrid } from "@/features/hall/hall-betting-grid";
import { useActivePlayerCurrency } from "@/hooks/use-active-player-currency";
import { HallDrawPanel } from "@/features/hall/hall-draw-panel";
import { HallWalletStrip } from "@/features/hall/hall-wallet-strip";
import { JackpotBurstOverlay } from "@/features/hall/jackpot-burst-overlay";
import { useHallDrawLive } from "@/features/hall/use-hall-draw-live";
import { useJackpotBurstLive } from "@/features/hall/use-jackpot-burst-live";
import { PlayerPanel } from "@/components/layout/player-panel";

/**
 * 下注大厅：钱包条 §4 + 当期期号 §4.2（封盘置灰 / 倒计时错误色 / WS+轮询）；玩法目录 §12.3；下注表格 §13.3。
 */
export function HallScreen() {
  const { t: tp } = useTranslation("player");
  const drawLive = useHallDrawLive();
  const { activeCurrency } = useActivePlayerCurrency();
  const { burstEvent, clearBurstEvent } = useJackpotBurstLive(tp);

  return (
    <>
      <PlayerPanel>
        <HallDrawPanel drawLive={drawLive} />
        <HallWalletStrip />
        <HallBettingGrid key={activeCurrency} drawLive={drawLive} />
      </PlayerPanel>
      <JackpotBurstOverlay event={burstEvent} onClose={clearBurstEvent} />
    </>
  );
}