- Refactored PlayerPanel layout for improved title positioning and responsiveness. - Added new function to check if betting is blocked based on hall status. - Updated HallDrawPanel to utilize the new betting status check and display appropriate messages. - Enhanced i18n support with new notices for review and non-bettable states across multiple languages.
49 lines
2.1 KiB
TypeScript
49 lines
2.1 KiB
TypeScript
export type DrawStatusHud = {
|
||
labelKey: string;
|
||
/** Tailwind 颜色类:状态圆点 */
|
||
dotClass: string;
|
||
/** 文案条(如「距封盘」) */
|
||
countdownKind: "close" | "draw" | "cooldown" | "none";
|
||
};
|
||
|
||
/**
|
||
* 界面文档 §4.2「封盘」展示:`closing`(封盘中)与 `closed`(待开奖)——
|
||
* 倒计时区域使用错误色 #ff4d4f,并提示「请选择下一期」。
|
||
*/
|
||
export function isHallSealedCountdownUi(status: string): boolean {
|
||
return status === "closing" || status === "closed";
|
||
}
|
||
|
||
/** 不可下注时展示阻断提示条 */
|
||
export function isHallBlockedForBetting(status: string): boolean {
|
||
return status !== "open";
|
||
}
|
||
|
||
/** 对齐界面文档 §4.2 状态文案与 PRD 期号状态 */
|
||
export function drawStatusHud(status: string): DrawStatusHud {
|
||
switch (status) {
|
||
case "pending":
|
||
return { labelKey: "draw.status.pending", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||
case "open":
|
||
return { labelKey: "draw.status.open", dotClass: "bg-emerald-500", countdownKind: "close" };
|
||
case "closing":
|
||
return { labelKey: "draw.status.closing", dotClass: "bg-rose-500", countdownKind: "draw" };
|
||
case "closed":
|
||
return { labelKey: "draw.status.closed", dotClass: "bg-amber-500", countdownKind: "draw" };
|
||
case "drawing":
|
||
return { labelKey: "draw.status.drawing", dotClass: "bg-sky-500", countdownKind: "none" };
|
||
case "review":
|
||
return { labelKey: "draw.status.review", dotClass: "bg-violet-500", countdownKind: "none" };
|
||
case "cooldown":
|
||
return { labelKey: "draw.status.cooldown", dotClass: "bg-cyan-500", countdownKind: "cooldown" };
|
||
case "settling":
|
||
return { labelKey: "draw.status.settling", dotClass: "bg-blue-600", countdownKind: "none" };
|
||
case "settled":
|
||
return { labelKey: "draw.status.settled", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||
case "cancelled":
|
||
return { labelKey: "draw.status.cancelled", dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||
default:
|
||
return { labelKey: status, dotClass: "bg-muted-foreground", countdownKind: "none" };
|
||
}
|
||
}
|