ariaLabel="内容分类"
value={tab}
onChange={switchTab}
options={[
{
key: "posts",
label: "帖子",
icon: ,
count: tabCount("posts"),
},
{
key: "comments",
label: "评论",
icon: ,
count: tabCount("comments"),
},
{
key: "messages",
label: "私信与群消息",
icon: ,
count: tabCount("messages"),
},
]}
/>
{error && (
{error}
)}
{!error && loading && posts.length + comments.length + messages.length === 0 && (
)}
{!error && !loading && total === 0 && (
)}
{tab === "posts" &&
posts.map((p) => (
{p.board_name && (
{p.board_name}
)}
{p.deleted ? (
{p.title || "(无标题)"}
) : (
{p.title || "(无标题)"}
)}
{p.content && (
{p.content}
)}
{formatRelative(p.created_at)}
))}
{tab === "comments" &&
comments.map((c) => (
{c.deleted ? (
帖子 #{c.post_id}
) : (
帖子 #{c.post_id}
)}
{c.content || "(空)"}
{formatRelative(c.created_at)}
))}
{tab === "messages" &&
messages.map((m) => (
{m.room_name}
{m.room_type === "direct" ? " · 私聊" : m.room_type === "group" ? " · 群聊" : ""}
{m.content || "(空)"}
{formatRelative(m.created_at)}
))}