- {summaries.length === 0 ? (
+ {groups.length === 0 ? (
No projects yet
@@ -36,47 +61,71 @@ export default async function HomePage() {
) : (
-
- {summaries.map(({ project, client, openCards, inboxCards }) => (
-
-
-
+
+ {groups.map((group) => (
+
+ {/* Only the owner sees more than one group — a client manager's
+ own name over their own projects would be noise. */}
+ {session.role === "owner" && (
+
-
-
- {project.name}
-
-
- {client.name}
-
-
- {inboxCards > 0 && (
-
-
- {inboxCards}
-
- )}
+
+ {group.client.name}
+
+ )}
-
-
- {openCards}
-
-
- open {openCards === 1 ? "card" : "cards"}
-
-
-
-
+
+
))}
-
+
)}
diff --git a/src/components/admin/project-form.tsx b/src/components/admin/project-form.tsx
index c540994..e81b1be 100644
--- a/src/components/admin/project-form.tsx
+++ b/src/components/admin/project-form.tsx
@@ -5,7 +5,7 @@ import { Plus } from "lucide-react";
import { createProject } from "@/app/actions/projects";
import { DEFAULT_BRAND_COLOR } from "@/lib/brand-default";
-import type { ClientRecord } from "@/lib/pb/types";
+import type { ClientRecord, ProjectRecord } from "@/lib/pb/types";
export function NewProjectForm({ clients }: { clients: ClientRecord[] }) {
const [open, setOpen] = useState(false);
@@ -14,6 +14,7 @@ export function NewProjectForm({ clients }: { clients: ClientRecord[] }) {
const [description, setDescription] = useState("");
const [repoOwner, setRepoOwner] = useState("");
const [repoName, setRepoName] = useState("");
+ const [kind, setKind] = useState("project");
const [pending, startTransition] = useTransition();
const [error, setError] = useState(null);
@@ -37,11 +38,13 @@ export function NewProjectForm({ clients }: { clients: ClientRecord[] }) {
repoOwner,
repoName,
color: DEFAULT_BRAND_COLOR,
+ kind,
});
setName("");
setDescription("");
setRepoOwner("");
setRepoName("");
+ setKind("project");
setOpen(false);
} catch (e) {
setError(e instanceof Error ? e.message : "Could not create that project");
@@ -132,6 +135,23 @@ export function NewProjectForm({ clients }: { clients: ClientRecord[] }) {
+