Notra/src/app/(editor)/page.tsx

23 lines
585 B
TypeScript

import Link from "next/link";
import { redirect } from "next/navigation";
import { getAuth } from "@/lib/auth";
import Editor from "@/components/editor/Editor";
export default async function Home() {
const auth = await getAuth();
if (auth) {
redirect("/notes");
}
return (
<div className="flex flex-col items-center gap-8">
<Editor />
<i className="text-center text-sm text-neutral-400">
Changes are not saved!<br />
<Link href="/login" className="font-bold hover:underline">Log in</Link> to save your notes.
</i>
</div>
);
}