"use client"; import type { ReactNode } from "react"; import Link from "next/link"; import { FORUM_RINGS } from "@/lib/forumRings"; import type { ForumSortMode } from "@/lib/forumSort"; type Props = { sort: ForumSortMode; onSortChange: (m: ForumSortMode) => void; search: string; onSearchChange: (q: string) => void; /** When set, show ring chips + `null` = all rings. Omit `onRingChange` to hide chips (ring sub-page). */ ringFilter: string | null; onRingChange?: (slug: string | null) => void; extraRight?: ReactNode; threadCount?: number; hydrated?: boolean; }; export default function ForumFeedToolbar({ sort, onSortChange, search, onSearchChange, ringFilter, onRingChange, extraRight, threadCount, hydrated, }: Props) { return (
{(["hot", "new", "top"] as const).map((m) => ( ))}
{onRingChange ? (
Ring {FORUM_RINGS.map((r) => ( ))}
) : null}
{hydrated === false ? "…" : threadCount !== undefined ? `${threadCount} threads` : null}
{extraRight} + New post
); }