2026-11-26 10:29:49 +00:00
|
|
|
import { redirect } from "next/navigation";
|
|
|
|
|
|
2026-11-26 13:31:00 +00:00
|
|
|
import { RepliesTabs } from "@/components/forum/RepliesTabs";
|
2026-11-26 10:29:49 +00:00
|
|
|
import { ThreadList } from "@/components/forum/ThreadList";
|
|
|
|
|
import type { ForumViewer, ThreadCard } from "@/lib/forum";
|
|
|
|
|
import { forumGet } from "@/lib/forumServer";
|
|
|
|
|
|
|
|
|
|
export const metadata = { title: "Követett szálak", robots: { index: false } };
|
|
|
|
|
|
|
|
|
|
/** The threads the member follows (their own and the ones they replied to), with what is new. */
|
|
|
|
|
export default async function FollowedPage() {
|
|
|
|
|
const res = await forumGet<{ viewer: ForumViewer; threads: ThreadCard[] }>("/v1/forum/followed");
|
|
|
|
|
if (!res.ok) redirect("/belepes?vissza=/forum/kovetett");
|
|
|
|
|
const { threads } = res.data;
|
|
|
|
|
return (
|
|
|
|
|
<div className="fh">
|
2026-11-26 13:31:00 +00:00
|
|
|
<h1 className="fpage-title">Válaszok</h1>
|
|
|
|
|
<RepliesTabs current="followed" />
|
2026-11-26 10:29:49 +00:00
|
|
|
<p className="muted">A saját szálaid, azok, amelyekhez hozzászóltál, és amelyeket követni kezdtél.</p>
|
|
|
|
|
{threads.length === 0 ? (
|
|
|
|
|
<p className="fh-card fh-empty">Még nem követsz egy szálat sem.</p>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="fh-card fh-flush">
|
|
|
|
|
<ThreadList threads={threads} />
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|