diff --git a/src/app/page.tsx b/src/app/page.tsx index a1c7c4d..7c3af7a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,10 +1,84 @@ -export default function Home() { +import Link from "next/link"; +import { redirect } from "next/navigation"; +import { Inbox } from "lucide-react"; + +import { AppShell } from "@/components/shell/app-shell"; +import { TopBar } from "@/components/shell/top-bar"; +import { Pill } from "@/components/ui/pill"; +import { getSession } from "@/lib/auth/session"; +import { loadProjectSummaries } from "@/lib/data/board"; + +export default async function HomePage() { + const session = await getSession(); + if (!session) redirect("/login"); + + const summaries = await loadProjectSummaries(); + return ( -
-

Client Board

-

- The board UI arrives in Plan 1b. Sign in at /login. -

-
+ + + +
+ {summaries.length === 0 ? ( +
+

No projects yet

+

+ {session.role === "owner" + ? "Create one from Manage, or run npm run seed for demo data." + : "Nothing has been shared with you yet."} +

+
+ ) : ( +
    + {summaries.map(({ project, client, openCards, inboxCards }) => ( +
  • + +
    + +
    +

    + {project.name} +

    +

    + {client.name} +

    +
    + {inboxCards > 0 && ( + + + {inboxCards} + + )} +
    + +
    + + {openCards} + + + open {openCards === 1 ? "card" : "cards"} + +
    + +
  • + ))} +
+ )} +
+
); } \ No newline at end of file