import { createClient } from "@/utils/supabase/server"; import Link from "next/link"; import { deletePost } from "./actions"; export default async function AdminPostsPage() { const supabase = await createClient(); const { data: posts } = await supabase .from("posts") .select("id, title, date, author, published, tags") .order("date", { ascending: false }); return (
| Title | Author | Date | Status | Actions |
|---|---|---|---|---|
|
{post.title}
{post.id} |
{post.author} | {new Date(post.date).toLocaleDateString()} | {post.published ? ( Published ) : ( Draft )} | Edit |
No posts found.
)}