All files / src/app/collections/new page.tsx

0% Statements 0/4
0% Branches 0/2
0% Functions 0/1
0% Lines 0/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
import { getSession } from "@/lib/auth";
import { redirect } from "next/navigation";
import { AppLayout } from "@/components/layout";
import { trail } from "@/components/layout/breadcrumb-trails";
import { CollectionForm } from "@/features/collections/CollectionForm";
 
export default async function CreateCollectionPage() {
  const session = await getSession();
  if (!session?.user) {
    redirect("/login");
  }
 
  return (
    <AppLayout breadcrumbs={trail.collectionNew()}>
      <div className="mx-auto w-full max-w-2xl">
        <h1 className="mb-6 text-2xl text-ink sm:mb-8 sm:text-3xl">Create collection</h1>
        <CollectionForm mode="create" />
      </div>
    </AppLayout>
  );
}