This commit is contained in:
Ivan Rezchikov
2026-07-11 21:20:57 +03:00
parent e192717466
commit 18161f4604
57 changed files with 1211 additions and 615 deletions
+18 -24
View File
@@ -1,6 +1,4 @@
import DraftsDialog from "@/components/drafts-dialog";
import Footer from "@/components/footer";
import Header from "@/components/header";
import { NewsCard } from "@/components/news-card";
import { Button } from "@/components/ui/button";
import { getPages } from "@/lib/pages/repository";
@@ -17,29 +15,25 @@ export default async function News() {
const drafts = [...newsDrafts, ...pageDrafts];
return (
<>
<Header />
<div className="flex flex-col p-16 gap-16">
<div className="flex flex-row items-center justify-between">
<h1>News</h1>
<div className="flex flex-row items-center gap-4">
{user?.isAdmin && (
<div className="flex flex-row items-center gap-4">
<DraftsDialog drafts={drafts} />
<Link href="/create/"><Button variant="secondary">Create a new page</Button></Link>
</div>
)}
</div>
</div>
<div className="flex flex-col gap-6">
{
news.length > 0 ? news.map((n) => (
<NewsCard news={n} key={n.id} />
)) : <h2 className="text-muted-foreground">There are no news yet...</h2>
}
<div className="flex flex-col p-4 md:p-16 gap-8 md:gap-16 mb-4 md:mb-0">
<div className="flex flex-col gap-4 md:flex-row md:items-center justify-between">
<h1>News</h1>
<div className="flex flex-row items-center gap-4">
{user?.isAdmin && (
<div className="flex flex-row items-center gap-4">
<DraftsDialog drafts={drafts} />
<Link href="/create/"><Button variant="secondary">Create a new page</Button></Link>
</div>
)}
</div>
</div>
<Footer />
</>
<div className="flex flex-col gap-6">
{
news.length > 0 ? news.map((n) => (
<NewsCard news={n} key={n.id} />
)) : <h2 className="text-muted-foreground">There are no news yet...</h2>
}
</div>
</div>
);
}