Add non-destructive dev seed on startup
This commit is contained in:
+96
-57
@@ -1,65 +1,104 @@
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
import { CalendarCheck2, ShieldCheck, Users } from "lucide-react";
|
||||
|
||||
import { auth } from "@/auth";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
// Eingeloggte User von der Landingpage direkt weiterleiten — die Routing-
|
||||
// Logik selbst (Onboarding vs. Dashboard) übernimmt `requireKitaSession`.
|
||||
export default async function LandingPage() {
|
||||
const session = await auth();
|
||||
if (session?.user) {
|
||||
redirect(session.user.kitaId ? "/dashboard" : "/onboarding");
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="flex flex-col flex-1 items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
||||
<main className="flex flex-1 w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
||||
<Image
|
||||
className="dark:invert"
|
||||
src="/next.svg"
|
||||
alt="Next.js logo"
|
||||
width={100}
|
||||
height={20}
|
||||
priority
|
||||
/>
|
||||
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
|
||||
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
|
||||
To get started, edit the page.tsx file.
|
||||
</h1>
|
||||
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
|
||||
Looking for a starting point or more instructions? Head over to{" "}
|
||||
<a
|
||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
||||
>
|
||||
Templates
|
||||
</a>{" "}
|
||||
or the{" "}
|
||||
<a
|
||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
||||
>
|
||||
Learning
|
||||
</a>{" "}
|
||||
center.
|
||||
</p>
|
||||
<div className="flex min-h-screen flex-col">
|
||||
<header className="border-b">
|
||||
<div className="mx-auto flex h-16 w-full max-w-6xl items-center justify-between px-6">
|
||||
<span className="text-lg font-semibold">Kita-Planer</span>
|
||||
<nav className="flex items-center gap-3">
|
||||
<Button asChild variant="ghost">
|
||||
<Link href="/login">Anmelden</Link>
|
||||
</Button>
|
||||
<Button asChild>
|
||||
<Link href="/register">Kita registrieren</Link>
|
||||
</Button>
|
||||
</nav>
|
||||
</div>
|
||||
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
|
||||
<a
|
||||
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
|
||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<Image
|
||||
className="dark:invert"
|
||||
src="/vercel.svg"
|
||||
alt="Vercel logomark"
|
||||
width={16}
|
||||
height={16}
|
||||
</header>
|
||||
|
||||
<main className="flex-1">
|
||||
<section className="mx-auto w-full max-w-6xl px-6 py-24">
|
||||
<div className="max-w-3xl">
|
||||
<p className="mb-4 inline-block rounded-full bg-secondary px-3 py-1 text-xs font-medium text-secondary-foreground">
|
||||
Für Elterninitiativen & Elternvereine
|
||||
</p>
|
||||
<h1 className="text-balance text-4xl font-semibold tracking-tight sm:text-5xl">
|
||||
Der digitale Kita-Planer für Elterninitiativen.
|
||||
</h1>
|
||||
<p className="mt-6 text-lg text-muted-foreground">
|
||||
Notdienst-Planung, Terminkalender und Stammdaten — endlich
|
||||
an einem Ort. Schluss mit Excel-Tabellen, WhatsApp-Listen und
|
||||
vergessenen Geburtstagen.
|
||||
</p>
|
||||
<div className="mt-8 flex flex-wrap gap-3">
|
||||
<Button asChild size="lg">
|
||||
<Link href="/register">Kita kostenlos registrieren</Link>
|
||||
</Button>
|
||||
<Button asChild size="lg" variant="outline">
|
||||
<Link href="/login">Bereits Mitglied? Anmelden</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-20 grid gap-8 sm:grid-cols-3">
|
||||
<FeatureCard
|
||||
icon={<ShieldCheck className="h-6 w-6" />}
|
||||
title="Notdienst-Planung"
|
||||
description="Verfügbarkeiten erfassen, fairen Plan automatisch generieren, Eltern bei Krankheitsausfall sofort alarmieren."
|
||||
/>
|
||||
Deploy Now
|
||||
</a>
|
||||
<a
|
||||
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
|
||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
</div>
|
||||
<FeatureCard
|
||||
icon={<CalendarCheck2 className="h-6 w-6" />}
|
||||
title="Terminkalender"
|
||||
description="Kita-Feste, Schließtage und private Anfragen mit Mitbringsel-Listen — übersichtlich für alle Eltern."
|
||||
/>
|
||||
<FeatureCard
|
||||
icon={<Users className="h-6 w-6" />}
|
||||
title="Eltern-Adressbuch"
|
||||
description="Spielverabredungen leichter machen — auf Opt-In-Basis und DSGVO-konform."
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer className="border-t">
|
||||
<div className="mx-auto flex h-16 w-full max-w-6xl items-center justify-between px-6 text-sm text-muted-foreground">
|
||||
<span>© {new Date().getFullYear()} Kita-Planer</span>
|
||||
<span>Made with ❤️ für Elternvereine</span>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function FeatureCard({
|
||||
icon,
|
||||
title,
|
||||
description,
|
||||
}: {
|
||||
icon: React.ReactNode;
|
||||
title: string;
|
||||
description: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="rounded-lg border bg-card p-6">
|
||||
<div className="mb-4 inline-flex h-10 w-10 items-center justify-center rounded-md bg-secondary text-secondary-foreground">
|
||||
{icon}
|
||||
</div>
|
||||
<h3 className="mb-2 text-lg font-semibold">{title}</h3>
|
||||
<p className="text-sm text-muted-foreground">{description}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user