import type { PrimaryTableCol } from "tdesign-react"; import { memo } from "react"; import { Card, PrimaryTable, Space, Tag } from "tdesign-react"; import type { TargetStatus } from "../../shared/api"; interface TargetGroupProps { columns: Array>; name: string; onTargetClick: (target: TargetStatus) => void; targets: TargetStatus[]; } export const TargetGroup = memo(function TargetGroup({ columns, name, onTargetClick, targets }: TargetGroupProps) { const up = targets.filter((t) => t.latestCheck?.matched).length; const down = targets.length - up; const displayName = name === "default" ? "默认分组" : name; return ( {up} {down} } headerBordered title={displayName} > onTargetClick(row)} rowClassName={({ row }) => { const target = row; return target.latestCheck?.matched === false ? "row-down" : ""; }} rowKey="id" size="small" stripe /> ); });