Files
sorsfonalak/services/frontend/src/app/forum/kovetett/page.tsx
T

28 lines
1.1 KiB
TypeScript
Raw Normal View History

import { redirect } from "next/navigation";
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">
<h1 className="fpage-title">Követett szálak</h1>
<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>
);
}