"use client"; import Link from "next/link"; import { BellRing, CheckCheck } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { PlayerPanel } from "@/components/layout/player-panel"; import { usePendingWalletReconcile } from "@/hooks/use-pending-wallet-reconcile"; import { formatPlayerInstant } from "@/lib/player-datetime"; import { formatMinorAsCurrency } from "@/lib/money"; import { isCreditFundingPlayer } from "@/lib/player-funding-mode"; import { pendingReconcileDescriptionKey, pendingReconcileTitleKey, } from "@/lib/pending-reconcile-notification"; import { usePlayerSessionStore } from "@/stores/player-session-store"; import { cn } from "@/lib/utils"; export function NotificationsScreen() { const { t } = useTranslation("player"); const creditMode = isCreditFundingPlayer(usePlayerSessionStore((state) => state.profile)); const { pending, unreadPending, unreadCount, loading, markAsRead, markAllAsRead } = usePendingWalletReconcile(); const unreadSet = new Set(unreadPending.map((item) => item.transfer_no)); return (
{creditMode ? (
{t("notifications.creditEmptyHint", { defaultValue: "信用盘无主站划转,暂无待对账通知。", })}
) : ( <>

{t("notifications.unreadCount", { count: unreadCount })}

{loading && pending.length === 0 ? (
{t("actions.loading")}
) : null} {!loading && pending.length === 0 ? (

{t("notifications.empty")}

) : null} {pending.length > 0 ? ( ) : null} )}
); }