import { createClient } from "@/utils/supabase/server"; import { deleteComment } from "./actions"; export default async function AdminCommentsPage() { const supabase = await createClient(); const { data: comments } = await supabase .from("comments") .select("id, name, email, comment, post_id, created_at") .order("created_at", { ascending: false }); return (

Comments

{comments?.map((comment) => ( ))}
Author Comment Post Date Actions

{comment.name}

{comment.email}

{comment.comment}

{comment.post_id} {new Date(comment.created_at).toLocaleDateString()}
{(!comments || comments.length === 0) && (

No comments found.

)}
); }