"use client" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Badge } from "@/components/ui/badge" import { Checkbox } from "@/components/ui/checkbox" import { Battery, Smartphone, Users } from "lucide-react" import type { Device } from "@/types/device" interface DeviceTableProps { devices: Device[] selectedDevices: string[] onSelectDevice: (deviceId: string, checked: boolean) => void onSelectAll: (checked: boolean) => void onDeviceClick: (deviceId: string) => void } export function DeviceTable({ devices, selectedDevices, onSelectDevice, onSelectAll, onDeviceClick, }: DeviceTableProps) { const allSelected = devices.length > 0 && selectedDevices.length === devices.length return (
onSelectAll(!!checked)} /> 设备信息 状态 微信账号 好友数 今日添加 加友状态 {devices.map((device) => ( onDeviceClick(device.id)} > e.stopPropagation()}> onSelectDevice(device.id, !!checked)} />
{device.name}
IMEI-{device.imei}
{device.remark &&
备注: {device.remark}
}
{device.status === "online" ? "在线" : "离线"}
{device.battery}%
{device.wechatId}
{device.friendCount}
+{device.todayAdded}
{device.addFriendStatus === "normal" ? "正常" : "异常"}
))}
) }