import Link from 'next/link';
import { FileText, Flame } from 'lucide-react';
export interface ActiveGroup {
chatroom_id: string;
name: string;
summary: string;
total: number;
top_senders: Array<{ sender: string; count: number }>;
}
export default function ActiveGroupsList({ groups, date }: { groups: ActiveGroup[]; date?: string }) {
const max = groups[0]?.total ?? 1;
return (
智能活跃群
去噪后 {groups.length} 个 · 前 10 个有日报入口
{groups.length === 0 ? (
暂无数据 · 点击「重扫」加载
) : (
{groups.slice(0, 12).map((g, i) => (
))}
)}
);
}
function Row({
group,
rank,
max,
date,
}: {
group: ActiveGroup;
rank: number;
max: number;
date?: string;
}) {
const initial = group.name.slice(0, 2);
const senders = group.top_senders
.slice(0, 3)
.map((s) => s.sender)
.join(' · ');
const pct = (group.total / max) * 100;
const groupHref = `/groups/${encodeURIComponent(group.chatroom_id)}${date ? `?date=${date}` : ''}`;
const reportHref = `/reports/groups/${encodeURIComponent(group.chatroom_id)}?date=${date}`;
return (
{rank}
{initial}
{group.name}
{senders && (
{senders}
)}
{group.total.toLocaleString()}
{rank <= 10 && date ? (
日报
) : (
)}
);
}