import { PageProps } from "@/app/(client)/[slug]/page";
import PostPage from "@/app/(client)/[slug]/page";
import ClientLayout from "@/app/(client)/layout";
import Post from "@/components/Post/Post";
import Tiptap from "@/components/Tiptap/Tiptap";

export default async function EditorPage({ params }: PageProps) {
    const { slug } = await params;

    const pageData = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/pages/${slug}`, {
        //next: { revalidate: 60 },
    }).then(res => res.json());

    return (
        <Tiptap slug={slug} data={pageData} />
    )
}