import { getCurrentDid } from "@/auth";
import { loadDrafts } from "@/data/drafts/queries";
import { DraftsClientPage } from "./DraftsClientPage";

export default async function DraftsPage() {
  const did = await getCurrentDid();
  if (!did) {
    return <DraftsClientPage initialDrafts={[]} />;
  }

  const drafts = await loadDrafts();
  return <DraftsClientPage initialDrafts={drafts} />;
}
