feat: update draw scheduling logic and add new translation keys
- Refactored HallDrawPanel to improve the logic for determining scheduled start and end times. - Introduced a new translation key for "scheduledEnd" in English, Nepali, and Chinese to support enhanced scheduling features. - Improved user experience by clearly differentiating between scheduled start, end, and close times.
This commit is contained in:
@@ -24,11 +24,16 @@ import type { DrawCurrentPayload } from "@/types/api/draw-current";
|
||||
|
||||
function ScheduleAnchorTime({ payload }: { payload: DrawCurrentPayload }) {
|
||||
const { t } = useTranslation("player");
|
||||
const useStart = payload.status === "pending" || payload.status === "open";
|
||||
const source = useStart
|
||||
const isPending = payload.status === "pending";
|
||||
const isOpen = payload.status === "open";
|
||||
const source = isPending
|
||||
? payload.start_time ?? payload.close_time ?? payload.draw_time
|
||||
: payload.close_time ?? payload.draw_time ?? payload.start_time;
|
||||
const labelKey = useStart ? "draw.scheduledStart" : "draw.scheduledClose";
|
||||
const labelKey = isPending
|
||||
? "draw.scheduledStart"
|
||||
: isOpen
|
||||
? "draw.scheduledEnd"
|
||||
: "draw.scheduledClose";
|
||||
const formatted = source ? formatLotteryInstant(source) : null;
|
||||
if (!formatted) {
|
||||
return (
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
"currentIssue": "Current issue",
|
||||
"currentTime": "Current Time",
|
||||
"scheduledStart": "Start time",
|
||||
"scheduledEnd": "End time",
|
||||
"scheduledClose": "Close time",
|
||||
"startsIn": "Starts in",
|
||||
"scheduleNow": "Current time {{now}} ({{tz}})",
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
"currentIssue": "हालको इश्यू",
|
||||
"currentTime": "हालको समय",
|
||||
"scheduledStart": "सुरु समय",
|
||||
"scheduledEnd": "समाप्ति समय",
|
||||
"scheduledClose": "बन्द समय",
|
||||
"startsIn": "सुरु हुन बाँकी",
|
||||
"scheduleNow": "हालको समय {{now}} ({{tz}})",
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
"currentIssue": "当前期号",
|
||||
"currentTime": "当前时间",
|
||||
"scheduledStart": "开始时间",
|
||||
"scheduledEnd": "结束时间",
|
||||
"scheduledClose": "封盘时间",
|
||||
"startsIn": "距开始",
|
||||
"scheduleNow": "当前时间 {{now}}({{tz}})",
|
||||
|
||||
Reference in New Issue
Block a user