import CloseOutlined from "@mui/icons-material/CloseOutlined"; import Drawer from "@mui/material/Drawer"; import IconButton from "@mui/material/IconButton"; import { DataState } from "@/shared/ui/DataState.jsx"; import { DataTable } from "@/shared/ui/DataTable.jsx"; import { formatMillis } from "@/shared/utils/time.js"; import styles from "@/features/red-packets/red-packets.module.css"; const claimColumns = [ { key: "userId", label: "用户", width: "minmax(120px, 0.7fr)", render: (claim) => claim.userId || "-", }, { key: "amount", label: "金额", width: "minmax(120px, 0.7fr)", render: (claim) => `${formatNumber(claim.amount)} 金币`, }, { key: "status", label: "状态", width: "minmax(100px, 0.55fr)", render: (claim) => claimStatusLabel(claim.status), }, { key: "createdAt", label: "领取时间", width: "minmax(180px, 0.9fr)", render: (claim) => formatMillis(claim.createdAtMs), }, ]; export function RedPacketDetailDrawer({ loading, onClose, open, packet }) { return (

红包详情

{packet ? (
claim.claimId} />
) : null}
); } function InfoRow({ label, value }) { return (
{label} {value}
); } function packetTypeLabel(type) { return type === "delayed" ? "延迟红包" : "普通红包"; } function packetStatusLabel(status) { const labels = { active: "进行中", finished: "已抢完", refunded: "已退款", waiting_open: "待开启", }; return labels[status] || status || "-"; } function claimStatusLabel(status) { return status === "claimed" ? "已领取" : status || "-"; } function formatNumber(value) { return new Intl.NumberFormat("zh-CN").format(Number(value || 0)); }