import Link from "next/link";
import {
Flame,
Users,
MessageCircle,
Heart,
Shield,
LayoutGrid,
PenLine,
PenSquare,
BarChart3,
TrendingUp,
} from "lucide-react";
import type {
PostListItem,
ActiveUser,
BoardWithCount,
BoardModerator,
BoardSidebarStats,
CheckinStatus,
} from "@/lib/api";
import Avatar from "@/components/Avatar";
import { PulseCheckin } from "./CheckinCard";
import { formatCompact } from "@/lib/format";
/* ---------- 1. 板块管理员 ---------- */
function Moderators({ items }: { items: BoardModerator[] }) {
return (
板块管理员
{items.length === 0 ? (
暂无板块管理员
) : (
{items.map((u) => {
const name = u.nickname || u.username;
return (
-
{name}
);
})}
)}
);
}
/* ---------- 2. 板块概况 ---------- */
function BoardIntro({ board }: { board: BoardWithCount }) {
return (
板块概况
{board.name}
{board.description ? (
{board.description}
) : (
暂无板块介绍
)}
讨论 {formatCompact(board.post_count)} 篇
);
}
/* ---------- 3. 板块数据 + 签到 ---------- */
function BoardPulse({
stats,
checkin,
}: {
stats: BoardSidebarStats;
checkin?: CheckinStatus | null;
}) {
const cells = [
{
icon: ,
label: "话题总数",
value: formatCompact(stats.post_count),
foot: `+${formatCompact(stats.today_posts)} 今日`,
up: true,
},
{
icon: ,
label: "今日新帖",
value: formatCompact(stats.today_posts),
foot: "本日新增",
up: stats.today_posts > 0,
},
{
icon: ,
label: "回复总数",
value: formatCompact(stats.comment_count),
foot: `+${formatCompact(stats.today_comments)} 今日`,
up: true,
},
{
icon: ,
label: "今日回复",
value: formatCompact(stats.today_comments),
foot: "本日新增",
up: stats.today_comments > 0,
},
];
return (
板块数据
{cells.map((c) => (
{c.icon}
{c.label}
{c.value}
{c.up && }
{c.foot}
))}
);
}
/* ---------- 4. 本板热门 ---------- */
function BoardHot({ posts }: { posts: PostListItem[] }) {
return (
本板热门
{posts.length === 0 ? (
本板还没有热门讨论
) : (
{posts.map((p, i) => (
-
{i + 1}
{p.title}
{p.comment_count}
{p.like_count}
))}
)}
);
}
/* ---------- 5. 本板活跃 ---------- */
function BoardActive({ users }: { users: ActiveUser[] }) {
return (
本板活跃
本周
{users.length === 0 ? (
本周本板还没有人互动
) : (
{users.map((u) => {
const name = u.nickname || u.username;
return (
-
{name}
发帖 {u.post_count}
回复 {u.comment_count}
{u.post_count + u.comment_count}
);
})}
)}
);
}
/* ---------- 装配 ---------- */
type BoardPanelsProps = {
board: BoardWithCount;
moderators: BoardModerator[];
stats: BoardSidebarStats;
hot: PostListItem[];
activeUsers: ActiveUser[];
checkin?: CheckinStatus | null;
};
function BoardPanelsBody(props: BoardPanelsProps) {
return (
<>
>
);
}
export function BoardPanels(props: BoardPanelsProps) {
return (
);
}
export function BoardPanelsMobile(props: BoardPanelsProps) {
return (
);
}
/** 板块不存在时的简卡 */
export function BoardMissingPanel() {
return (
);
}