import EditOutlined from "@mui/icons-material/EditOutlined"; import RefreshOutlined from "@mui/icons-material/RefreshOutlined"; import { Button } from "@/shared/ui/Button.jsx"; import styles from "@/features/red-packets/red-packets.module.css"; export function RedPacketConfigSummary({ canUpdate, config, configLoading, onEdit, onRefresh }) { return (
{config?.enabled ? "启用" : "停用"} {formatTiers(config?.countTiers)} {formatTiers(config?.amountTiers)} {Number(config?.delayedOpenSeconds || 0)}s / 24h {Number(config?.dailySendLimit || 0)} 次 {config?.ruleUrl || "-"}
{canUpdate ? ( ) : null}
); } function SummaryItem({ children, label }) { return (
{label} {children}
); } function formatTiers(values) { if (!values?.length) { return "-"; } const visible = values.slice(0, 4).join("、"); return values.length > 4 ? `${visible} +${values.length - 4}` : visible; }