"use server";

import { auth, signIn } from "@/auth";
import { getClipboard } from "./action";
import ClipboardComponent from "./ClipboardComponent";

export default async function ClipboardPage() {
  if ((await auth())?.user == null) {
    await signIn();
  }

  const clipboard = await getClipboard();
  return (
    <>
      <ClipboardComponent initialContent={clipboard} />
    </>
  );
}
