import Link from "next/link"; import { Plus, Edit, ExternalLink } from "lucide-react"; import { PageHeader } from "@/components/admin/form"; import { DeleteButton } from "@/components/admin/delete-button"; import { listAllPosts } from "@/lib/data"; import { deleteBlogPost } from "@/lib/admin-actions"; export default async function BlogListPage() { const posts = await listAllPosts(); return (
Yeni yazı } />
{posts.length === 0 && ( )} {posts.map((p) => ( ))}
Başlık Slug Durum Yayın İşlem
Henüz yazı yok. İlk yazınızı oluşturun.
{p.title} /{p.slug} {p.published_at ? new Date(p.published_at).toLocaleDateString("tr-TR") : "—"}
{p.status === "published" && ( )} Düzenle
); } function StatusBadge({ status }: { status?: string | null }) { const isPub = status === "published"; return ( {isPub ? "Yayında" : "Taslak"} ); }