"use client" import { Card } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Clock, TrendingUp, Users } from "lucide-react" interface StatsCardProps { title: string value: string | number description?: string trend?: number trendLabel?: string className?: string valueClassName?: string } /** * 统计数据卡片 * 用于展示关键指标数据 */ export function StatsCard({ title, value, description, trend, trendLabel, className = "", valueClassName = "text-xl font-bold text-blue-600", }: StatsCardProps) { return (
{title}
{value}
{description &&
{description}
} {trend !== undefined && (
= 0 ? "text-green-600" : "text-red-600"}`}> {trend >= 0 ? "↑" : "↓"} {Math.abs(trend)}% {trendLabel || ""}
)}
) } interface DistributionPlanCardProps { id: string name: string status: "active" | "paused" | "completed" source: string sourceIcon: string targetGroups: string[] totalUsers: number dailyAverage: number lastUpdated: string createTime: string creator: string onView?: (id: string) => void onEdit?: (id: string) => void onDelete?: (id: string) => void onToggleStatus?: (id: string, status: "active" | "paused") => void } /** * 流量分发计划卡片 * 用于展示流量分发计划信息 */ export function DistributionPlanCard({ id, name, status, source, sourceIcon, targetGroups, totalUsers, dailyAverage, lastUpdated, createTime, creator, onView, onEdit, onDelete, onToggleStatus, }: DistributionPlanCardProps) { return (
{sourceIcon}

{name}

{status === "active" ? "进行中" : status === "completed" ? "已完成" : "已暂停"}
{onToggleStatus && status !== "completed" && ( )} {onView && ( )} {onEdit && ( )}
目标人群:{targetGroups.join(", ")}
总流量:{totalUsers} 人
日均获取:{dailyAverage} 人
创建人:{creator}
上次更新:{lastUpdated}
创建时间:{createTime}
) }